Linux Cheat Sheet For File Commands
Formatted listing with hidden files
ls -al. Nowadays most of the terminals come with
llcommand to do the trick.
$ cd ashokma
cdwill get you home. ^_^
$ mkdir ashokma
-poption with the above command, creates directories as needed like
mkdir -p ashokma/ashkeys/sojiro
$ cat >ashkeysHow are we doing today?Good.# Ctrl + C to exit$ cat ashkeysHow are we doing today?Good.
Comes in handy to quickly take notes. \O/
$ more ashkeys.txt
head ashkeys.txtto output the first 10 lines of the file and
tail ashkeys.txtto output the last 10 lines of the file.
$ touch ashkeys.txt
As it says it can just be used to touch a file (simply update the timestamp) to make it look like updated recently. /O\
$ rm ashkeys.txt$ rm -r ashokma
Use force option
$ cp source.txt target.txt$ cp -r source target
$ mv ashkeys.txt ashokma/
Also widely used to rename a file quickly as
mv oldname.txt newname.txt
$ ln -s ashkeys.txt shortcut_to_ashkeys.txt