I have been using the command line for more than 10 years now, I started on MacOS1 and I increased my usage of the Terminal when I switched to Linux. I am now comfortable with the Linux command line but still looking for ways to improve my skills. Recently, I stumbled into no starch press that offers a great selection of books and found out that several are available at the library. That’s how I booked The Linux command line by William Shotts.
The book does a fantastic jobs explaining why and how to work with Linux command line. William Shotts gives to the reader just the right level of details to understand how the shell works and why it is so powerful. The first part “Learning the shell” introduces the most important commands. Here I am listing 1. a few topics that I am very glad I read more about and 2. the list of commands introduced in the book. I strongly recommend the reading of this book and if for any reason you cannot buy it or book it, note that the author maintains a website (https://linuxcommand.org/index.php) that includes most of the material covered in the book (with less details).
Below is a list of five topics that reading about have already been beneficial. Note that this list is personal, all the 10 first chapters cover important topics and the way material is presented is very didactic.
- reading the
ls -l
output; - the logic and the power of i/o redirection, e.g importance of standard input;
- expansions;
- softlinks and hardlinks;
- permission (including the sticky bit).
The following table2 includes commands that are introduced in the first part (except du
and shuf
that I added my-self).
Note that there are bash
commands and if you use a different shell (e.g. zsh
) some commands may be missing (there are likely equivalent commands available).
Options presented in the table are the ones that are either presented in the book, or options that I think are the most important ones (meaning the one you are ore likely to use).
The command ‘Usage’ indicates how frequently I use a given command: one star means daily, 2 means weekly and 3 means every now and then.
Last, Category
is my attempt to categorize the commands, in the book commands are introduced in different chapters, which makes it clear in what context you are expected to use them.
Command | Description | Options | Category | Usage |
---|---|---|---|---|
date | print or set the system date and time | -u | date | ⭐ ⭐ |
cal | displays a calendar | -j , -3 | date | ⭐ |
file | determine file type | inform | ⭐ ⭐ ⭐ | |
man | an interface to the system reference manuals | inform | ⭐ ⭐ ⭐ | |
which | locate a command | inform | ⭐ ⭐ | |
type | display information about command type | inform | ⭐ | |
help | display information about builtin commands | inform | ⭐ | |
apropos | search the manual page names and descriptions | inform | ⭐ | |
info | read Info documents | inform | ⭐ | |
whatis | display oneāline manual page descriptions | inform | ⭐ | |
cp | copy files and directories | -a , -r , -i , -u , -v | manage files | ⭐ ⭐ ⭐ |
mv | move (rename) files | -i , -u , -v | manage files | ⭐ ⭐ ⭐ |
mkdir | create new directory | -h , -m | manage files | ⭐ ⭐ ⭐ |
rm | remove files or directories | -i , -r , -f , -vq | manage files | ⭐ ⭐ ⭐ |
ln | make links between files | -s , -r , -v | manage files | ⭐ |
less | a pager | manipulate | ⭐ ⭐ ⭐ | |
cat | concatenate files and print on the standard output | -n | manipulate | ⭐ ⭐ ⭐ |
wc | print newline, word, and byte counts for each file | -c , -m , -l , -w | manipulate | ⭐ ⭐ |
head | output the first part of files | -n | manipulate | ⭐ ⭐ |
tail | output the last part of files | -n | manipulate | ⭐ ⭐ |
tee | read from standard input and write to standard output and files | manipulate | ⭐ ⭐ | |
sort | sort lines of text files | -r | manipulate | ⭐ |
uniq | report or omit repeated lines | -c , -D | manipulate | ⭐ |
shuf | generate random permutations | -r | manipulate | ⭐ |
top | display Linux processes | monitor | ⭐ ⭐ ⭐ | |
kill | send a signal to a process | -l , -INT , -9 | monitor | ⭐ ⭐ ⭐ |
shutdown | halt, power off or reboot the machine | -r , -c | monitor | ⭐ ⭐ ⭐ |
du | estimate file space usage | -s , -h | monitor | ⭐ ⭐ |
jobs | display status of jobs. | monitor | ⭐ ⭐ | |
bg | Move job to the background | monitor | ⭐ ⭐ | |
fg | Move job to the foreground | monitor | ⭐ ⭐ | |
df | report file system space usage | -h | monitor | ⭐ |
free | display amount of free and used memory in the system | -h | monitor | ⭐ |
killall | kill processes by name | -g , -i | monitor | ⭐ |
pwd | print name of current/working directory | navigate | ⭐ ⭐ ⭐ | |
cd | change the shell working directory | navigate | ⭐ ⭐ ⭐ | |
ls | list directory contents | -ls , -t , -h , --reverse | navigate | ⭐ ⭐ ⭐ |
su | run a command with substitute user and group ID | -c | permission | ⭐ ⭐ ⭐ |
sudo | execute a command as another user | -u | permission | ⭐ ⭐ ⭐ |
chmod | change file mode bits | permission | ⭐ ⭐ | |
chown | change file owner and group | permission | ⭐ ⭐ | |
id | print real and effective user and group IDs | -u , -g , -G | permission | ⭐ |
umask | set file mode creation mask | permission | ⭐ | |
chgrp | change group ownership | permission | ⭐ | |
passwd | change user password | permission | ⭐ | |
grep | print lines that match patterns | -e , -i , -f | search | ⭐ ⭐ ⭐ |
Back then, I jotted down some notes about my usage of the terminal https://github.com/inSileco/AvecLeTerminal/tree/master. ↩︎
Commands are stored in a yaml file and convert into the table displayed here via a R script. ↩︎