[Hampshire] GNU Linux mnemonics

Top Page

Reply to this message
Author: Damian Brasher
Date:  
To: hampshire
Subject: [Hampshire] GNU Linux mnemonics
Hi list

On for the summer holidays to ponder over...

GNU Linux (and UNIX for those that do or did) command line interface has
thousands of interactive commands as we all know. Over the years a Linux
user will learn many but in general these commands can be counter
intuitive (usually inordinately logical if you have time to understand the
underlying technology - most of us don't) and do not commit to memory
easily. Once a user has a set of commands committed to memory then Linux
command line console becomes a hugely powerful tool.

As I was learning Linux and especially during my RHCT training I wanted
there to be a nice set of mnemonics to help me commit commands to memory -
there isn't that I know about. I have therefore made up a couple and if
other HL readers have their own home made (or inherited) mnemonics I think
it would be useful to compile them here for newbies and experienced
readers (literally any command, regex, one-liner bash/perl script
qualifies) alike.

The mnemonics can be visual like my second example or textural like my
first, to get the thread going:

1) A simple recursive grep search:

]#grep -R needle *
mnemonic - "Like looking for a needle in a haystack"

This indicates the order of search string "needle" and target "*"
haystack, which could be i.e. 20,000 files (a haystack of files).

2) Creating a symlink:

]#ln -s /usr/local/targetfile .

This visual mnemonic illustrates the order in which you type the target
file "targetfile" and desired symlink location which can be tricky to
remember at first. As long as you remember you can link "targetfile" to
the "." your current directory position then the order is implicit. You
can replace the "." with any directory.

3) Convert chmod 'numeric' to 'textual meaning':

remember - rwx (read,write,execute)
remember - 421 - the first three decimal values in the base2 number system
(binary) conversion.

i.e.

]#chmod 777 = 4+2+1 4+2+1 4+2+1 = rwx rwx rwx
]#chmod 654 = 4+2+0 4+0+1 4+0+0 = rw- r-x r--

'-' corresponds to a '0' and each triplet represents 'owner - group - other'

and so on...

Damian

--
Damian L Brasher ...RHCE...
http://www.diap.org.uk