Linux 101 Command Line Cheat Sheet, Study notes of Linux skills

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

2021/2022

Uploaded on 08/05/2022

dirk88
dirk88 🇧🇪

4.4

(222)

3.1K documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1/5
Linux 101 Command Line Cheat Sheet
Abstract
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.
Where to Acquire
These tools are installed natively in most Unix/Linux distributions, as well as OS X.
Examples/Use Case
bash basics
cat
cd
echo
ls
networking
passwd
ping
pwd
sudo
bash basics
Tab-completion:
Folks who are new to the Unix/Linux command line often attempt to type ever ything 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 <TAB> key:
$ cat /etc/pas
pf3
pf4
pf5

Partial preview of the text

Download Linux 101 Command Line Cheat Sheet and more Study notes Linux skills in PDF only on Docsity!

Linux 101 Command Line Cheat Sheet

Abstract

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.

Where to Acquire

These tools are installed natively in most Unix/Linux distributions, as well as OS X.

Examples/Use Case

bash basics cat cd echo ls networking passwd ping pwd sudo

bash basics

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 key: $ cat /etc/pas

Then press . Note that it autocompletes to /etc/passwd. Now try tabbing with ambiguity: $ cd ~/Do Then press . Note that it offers two choices: Documents/ Downloads/. Now add a "w" and press : $ cd ~/Dow Press . It autocompletes to ~/Downloads/.

cat

Display a file: $ cat example.txt Concatenate (cat) FileA.txt and FileB.txt, create FileC.txt: $ cat FileA.txt FileB.txt > FileC.txt

cd

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

networking

Show network interface configuration: $ ifconfig Show network interface configuration using "ip": $ ip a Restart networking: $ sudo /etc/init.d/networking restart

passwd

Change your password: $ passwd

ping

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.

pwd

Print Working Directory (pwd), show the current directory: $ pwd

sudo

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.