| Home | Notes | Github |
|---|
Written: 05-Mar-2022
There are two key meta commands that really unlocked the linux command line for me. They allow you to discover commands and how to use them without having to look at tutorials or happen across them through sheer serendipity alone. They are:
apropos
man
apropos allows you to find a command. A usage might be
apropos spell to find a spellchecker, which would yield
aspell amongst other results. The small description
alongside the commands would allow you to see which was the best
fit.
man is the manual page for each command 1. This explains how commands are
used, and sometimes gives examples of common use-cases.
Use them in conjunction to discover and confirm programs that might be useful to you.
Beyond those two there are several basic commands I’d learn for simple navigation around folders2 :
ls - listcd - change directorypwd - print working directorymv, rm, cp - move,
remove and copy respectively allow you to change the
location of files and folders. 3mkdir - make directory… pretty self
explanatoryfind - finds files, somewhat unsurprisingly.
I’d strongly recommend looking up basic usage because it’s so useful,
but needs a little coaxing.These are functions I use a lot4
grep - get regular expression - useful for searching a
body of text. Tut
4 covers the basics of regex.cat - originally for concatenating files, this is
useful as it prints a files contents to the terminal.head/tail - prints the top and bottom 11
lines of a file to the terminal. Useful for long files.rsync - a more advanced move command. It has powerful
uses including moving files to and from remote servers.echo - echos the input back out on the
terminal. Useful for debugging scripts.nano - Allows you to write and edit text files.sed - Stream EDitor - edits strings. Useful in
conjunction with other commands.cowsay/figlet - you may need to install
them, but they’re a bit of fun. Just run either with a couple words
after.