Viewing, Creating, and Editing Files
Cat Command
Displays the contents of
Hey.txt.
cat Hey.txt 
Overwrite
Creates or overwrites
Hey.txtwith the textHello.
echo "Hello" > Hey.txt
Append
Appends
Hello again againto the end ofHey.txt.
echo "Hello again again" >> Hey.txt
Touch Command
The
touchcommand is used to quickly create empty files, update timestamps of existing files, or check if a file exists in scripts.
touch hello.txt
Gedit Command
The command
gedit hello.txtopens the filehello.txtin the Gedit text editor, allowing you to view or edit its contents in a graphical interface.
gedit hello.txt

Nano Command
The command
nano hello.txtopens the filehello.txtin the Nano text editor, allowing you to edit it directly in the terminal.
nano hello.txt

Last updated