I’ve spent several weeks out and about teaching Linux basics to a wide variety of people. Some had an IT background others did not. This alone makes feedback and questions interesting. Different people ask very different questions making even the most basic Linux training a great learning opportunity for me as a trainer.
Having almost two decades of Linux usage under my belt it’s easy to think that I’ve seen it all. Truth is that I’ve seen only those bits that I needed to get the job done. So there are still some commands I never heard about. Take dir
for example. Not in a million years I would have even considered using this command to list directory contents. It’s a DOS command and I’m not keen on those. For me it has always been ls
and nothing else.
One of my students used dir
and I was wondering at first if he just set an alias. Turns out the command is actually part of the coreutils collection. Even more interesting is the fact that dir
works a little different then ls
. The original idea of ls
is to display a line for each object found. This can clearly be seen when you reroute the Std-Out to a file:
root@training:~# ls / > ~/lsout
root@training:~# cat ~/lsout
bin
boot
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
You might notice that this looks different from the output ls
produces in the interactive command prompt. The reason is that devs decided to use the horizontal space rather then make you scroll forever showing mostly dead space.
dir
on the other hand creates the exact same column output you know from the command prompt:
root@training:~# dir / > ~/dirout
root@training:~# cat ~/dirout
bin dev home lib64 media opt root sbin sys usr
boot etc lib lost+found mnt proc run srv tmp var
If you write shell scripts, the latter option might not be very useful for you.
Obviously this is just a small example that seems almost insignificant. But that’s my point. It’s something you would probably not think about.
By teaching Linux fundamentals these small gaps in my own knowledge come to light. Useful options of well known commands that I’ve used a million times. Configuration options I didn’t think about. New tools I’ve never heard about before. Or even a quick refresh of long forgotten things that I don’t use often. Sometimes I’m even forced to come up with a quick shell script of sorts to test something. Some of these end up in my “useful toolbox” for later use.
No matter what it is you do, chances are you don’t know everything. Teaching is a great way to find those gaps and fill them.
Never stop learning and stay curious.