Far from a comprehensive list.
Switching back and forth between directories using cd -;
$ cd ~/Downloads
$ cd ~/Documents
$ cd -
Use
cdto enter directoryDownloadsthenDocumentand then return to directoryDownloads.
Basic globbing to ls multiple directories or cat multiple files;
$ ls -l ~/{Downloads,Documents}
$ cat /var/log/{example1,example2}.log
$ cat /var/log/example*
Verify contents of
DownloadsandDocumentsdirectories. Usecatto print the contents ofexample1.logandexample2.logto console. Usecatto print the contents of all files matching/var/log/example*to console.
Repeat last command using !!;
$ systemctl status httpd
$ sudo !!
Run a command, then realise you need
sudoand repeat it appending the previous command to it.
Use last argument using !$;
$ ls -l /var/log/example.log
$ vim !$
Confirm a file exists using
ls, then usevimto open the last argument of the previous command.
Using less to display colors;
$ less -r /var/log/syslog
$ less --raw-control-chars /var/log/syslog
Will, among others, display color instead of escaped control chars.
Using less to tail;
$ less +F /var/log/syslog
Roughly resembles
tail -f /var/log/syslogbut allows the user to start navigating/searching/.. at any time. UseFto return to "watching" the file.