Bash Commands Cheat Sheet
Basic file manipulation click to collapse contents
To display file content
$ cat fileName
To place standard input into a file
$ cat > myFile
To change current directory
cd
To copy a file or a directory
$ cp originalFileName newFileName
$ cp originalFileName folderName
To display formatted listing of a current directory content
$ ls -l
To display directory listing
$ ls
To display directory listing with hidden files
$ ls -al
To create a directory dirName
$ mkdir dirName
To rename or move file
$ mv orignalFileName newFileName
To create a file
$ touch fileName
To print current working directory
$ pwd
To remove specified file
$ rm fileName
To delete directory dirName
$ rm -f dirName
To display a count of lines, words and characters in a file
$ wc fileName
To create symbolic link
$ ln -s file link
To output the first 10 lines of the file
$ head fileName
To output the last 10 lines of the file
$ tail fileName
To output the contents of file as it grows, staring with the last 10 lines
$ tail -f file
Basic Terminal Navigation click to expand contents
Basic Terminal Shortcuts click to expand contents
Extract, sort and filter data click to expand contents
Researching Files click to expand contents
Create and modify user accounts click to expand contents
Installing software click to expand contents
Ubuntu CheatSheet Home