File Commands How to list a directory in linux
Tip: Formatted listing with hidden files ls -al. Nowadays most of the terminals come with ll command to do the trick.
How to change to a directory in linux
Tip: Just entering cd will get you home. ^_^
How to show current working directory in linux
How to create a directory in linux
Tip: -p option with the above command, creates directories as needed like mkdir -p ashokma/ashkeys/sojiro
1 2 3 4 5 6 7 8 $ cat >ashkeys How are we doing today? Good. $ cat ashkeys How are we doing today? Good.
Tip: Comes in handy to quickly take notes. \O/
How to output the contents of a file in linux
Tip: Use head ashkeys.txt to output the first 10 lines of the file and tail ashkeys.txt to output the last 10 lines of the file.
How to create or update a file in linux
Tip: As it says it can just be used to touch a file (simply update the timestamp) to make it look like updated recently. /O\
How to delete a file or directory in linux 1 2 $ rm ashkeys.txt $ rm -r ashokma
Tip: Use force option -f if necessary.
How to copy contents of a file or directory to the other in linux 1 2 $ cp source.txt target.txt $ cp -r source target
How to move file in linux 1 $ mv ashkeys.txt ashokma/
Tip: Also widely used to rename a file quickly as mv oldname.txt newname.txt
How to create a file shortcut in linux (symbolic link) 1 $ ln -s ashkeys.txt shortcut_to_ashkeys.txt