



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Folks who are new to the Unix/Linux command line often attempt to type everything by hand. This may work well if you type quickly and accurately.
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Fundamental Linux/Unix commands for the Linux/Unix command line learner. If you are experienced with Linux/Unix: you have probably mastered these commands. If not: you are in the right place. Note: Some of the examples below presume files and paths that might not match your particular system and tool installation.
These tools are installed natively in most Unix/Linux distributions, as well as OS X.
bash basics cat cd echo ls networking passwd ping pwd sudo
Tab-completion: Folks who are new to the Unix/Linux command line often attempt to type everything by hand. This may work well if you type quickly and accurately. Most of us are much better off using tab completion. Note that Windows PowerShell also supports tab completion, but it handles ambiguity differently. See the PowerShell cheat sheet for more information. Type the following, and then press the
Then press
Display a file: $ cat example.txt Concatenate (cat) FileA.txt and FileB.txt, create FileC.txt: $ cat FileA.txt FileB.txt > FileC.txt
Change Directory (cd) to the /tmp directory: $ cd /tmp Change to the home directory. The following commands are equivalent for the "student" user: "~" means home directory (for example: /home/student): $ cd
$ ls -lat List the files in the current directory, long output (-l), all files (-a), reverse (-r) sort by time (- t): $ ls -lart
Show network interface configuration: $ ifconfig Show network interface configuration using "ip": $ ip a Restart networking: $ sudo /etc/init.d/networking restart
Change your password: $ passwd
ping a host forever (until CTRL-C is pressed), see if it is up (and unfiltered): $ ping 10.5.11.
ping a host 3 times, see if it is up (and unfiltered): $ ping -c3 10.5.11.
Print Working Directory (pwd), show the current directory: $ pwd
Run a command as root: $ sudo command Open a root bash shell: $ sudo bash Additional Info A printable PDF version of this cheatsheet is available here: LinuxCLI Cheat Sheet Version Version 1.