Last active
August 11, 2024 08:16
-
-
Save Gavriel770U/b0906ada292b7e991470b65231ea59c6 to your computer and use it in GitHub Desktop.
Linux Terminal Creating New File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
touch way1.txt | |
echo "This is the second way!" > way2.txt | |
> way3.txt | |
printf "This is the fourth way!\n" > way4.txt | |
>> way5.txt | |
# The sixth way is made if way 5 is too much like way 3, | |
# But you have to insert some data and then press CTRL+C to write to the file and save it. | |
cat > way6.txt | |
cp /dev/null way7.txt | |
dd if=/dev/zero of=way8.txt bs=1 count=0 | |
truncate -s 0 way9.txt |
Hi
Hello
user@hostname:~$ cp /dev/null filename
user@hostname:~$ cp /dev/null filename
cool i will add it, thanks :D
Additional:
user@hostname:~$ dd if=/dev/zero of=way8.txt bs=1 count=0
0+0 records in
0+0 records out
0 bytes copied, 0.0352241 s, 0.0 kB/s
user@hostname:~$ truncate -s 0 way9.txt
Additional:
user@hostname:~$ dd if=/dev/zero of=way8.txt bs=1 count=0 0+0 records in 0+0 records out 0 bytes copied, 0.0352241 s, 0.0 kB/s user@hostname:~$ truncate -s 0 way9.txt
ok i will add them too lol thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Microsh1t Linux :D