[mdlug] Looking for Shell Accounts

Aaron Kulkis akulkis00 at gmail.com
Fri Jul 8 23:16:26 EDT 2011


Brandon F wrote:
> Hello everyone,
> 
> First of all I want to say hello to everyone again, I'm a longtime reader
> but first time poster.
> 
> I manage a small BPO team and a couple of my members want to expand their
> skills beyond Level 1.  I've been recommending Linux to them based on my
> appreciation for the toolset and the opportunity it can give them to get out
> of helpdesk hell.  So far we've all been studying for the first two Linux
> Professionals Institute certification tests but while I have a few working
> systems, my people are pretty green.
> 

I'm going to dump a LOT on you -- enough that it could take you
easily 4-8 weeks to wade through it all, so print out this
e-mail and hang it next to your desk for reference.

There's a LOT that can be learned without ever being root.
Just set up one system running Linux in and give everyone
a user account on it, and let them ssh into the box.

get them learning how to
1: use pipelines ( the "|" character to route the
output of one command into the input of another command)

compare:
$ ls -al /usr/bin
with
$ ls -al /usr/bin | more


2: the following commands in pipelines

grep
tr
sed
awk

compare:
$ ls -al /usr/bin | more
with
$ ls -al /usr/bin | grep a | more
with
$ ls -al /usr/bin | awk '{ printf "%s %s %s %s %s\t%s\n", \
                                    $1,$2,$3,$4,$5,$9}' | grep a | more
with
$ ls -al /usr/bin | awk '{ printf "%s %s %s %s %s\t%s\n", \
                                 $1,$2,$3,$4,$5,$9}' | grep -i a | more
with
$ ls -al /usr/bin/{a,A}* | more
with
$ ls -al /usr/bin | grep -i /a | more
with
$ ls -al /usr/bin/a* | tr "a" "z" | more
with
$ ls -al /usr/bin/a* | sed -e "s/a/_There_Was_An_a_Here/" | more
with
$ ls -al /usr/bin/a* | sed -e "s/a/_There_Was_An_a_Here/g" | more


learn some basic shell scripting

and learn all of the commands in here:
<http://cm.bell-labs.com/7thEdMan/v7vol1.pdf>

and FAMILIARIZE yourself with:

<http://cm.bell-labs.com/7thEdMan/v7vol2a.pdf>
<http://cm.bell-labs.com/7thEdMan/v7vol2b.pdf>


learn to use the man command.

for help on that
$ man man

also, learn to use
$ man -k  keyword
or
$ apropros keyword
[where keyword is some search term you provide]

as in

$ man ls
as opposed to
$ man -k directory
or more readable these days:
$ man -k directory | grep 1 | more


Lastly, learn regular expressions.

If you're NOT LOGGED INTO ROOT, you can't do any damage
to anything.

Poke around the system as a normal user, and learn to how
to manipulate the output of various commands using pipelines
and the commands grep, sed, awk, tr, basename, dirname,  and so forth.

These skills, plus learning how to read the manual pages, [and
using man -k or apropos to identify the right manual pages to read]
are FAR more important for being a good administrator
than remembering the exact command to resize a filesystem,
or how to add more physical blocks of disk space to a
logical volume.

In fact, I don't even bother remembering such commands --
that's PRECISELY what man -k  / apropos were invented for!
[If you asked me what the commands to perform those tasks
are, I couldn't tell you -- they're different on each
flavor of Unix out there, so I've never bother remembering --
all I know is that they exist on Solaris, HP-UX, Linux, etc.
The fact that I know the commands exist, and that I can
find them using man -k, and then being able to read the
manual page when I need to use these commands is sufficient.
In fact on such rarely used commands, you SHOULD NEVER RELY
UPON YOUR MEMORY -- ALWAYS review the system's manual page
first -- lest your really screw something up!!!!]

By the way, the majority of the commands are in section 1
of the manual
typically the documentation for those commands are stored
in /usr/share/man/man1

The commands that can only be run by root are documented
in section 8 of the manual
documentations is typically stored in   /usr/share/man/man8

note that when you do
$ man ls
the pages will start with:
LS(1)     User Commands             LS(1)

but say, running a filesystem consistency check is documented
in section 8
$ man fsck
FSCK(8)        MAINTENANCE COMMANDS        FSCK(8)

The manual 1 sections are:
1 -- user commands
$ man 1 intro
$ ls -C /usr/share/man/man1| less

2 -- system calls (used by C programmers, no use for you)
$ man 2 intro
$ ls -C /usr/share/man/man2| less

3 -- library calls (used by C, Fortran, Java, etc. programmers)
	the only ones useful to you MIGHT be the perl libraries
$ man 3 intro
$ ls -C /usr/share/man/man3| less

4 -- special files which are ALL found in the /dev directory
$ man 4 intro
$ ls -C /usr/share/man/man4| less

5 -- file formats   have a file in /etc that you don't understand?
		it's probably documented in section 5
$ man 5 intro
$ ls -C /usr/share/man/man5| less

6 -- games (some, definitely NOT all)
$ man 6 intro
$ ls -C /usr/share/man/man6| less

7 -- overview, conventions, protocols, character standards,
	file system layout, and other miscellaneous topics.
$ man 7 intro
$ ls -C /usr/share/man/man7| less

8 -- administrator and privileted commands
$ man 8 intro
$ ls -C /usr/share/man/man8| less

9 -- device drivers and kernel hacker stuff.
      Not important for you.
$ man 9 intro
$ ls -C /usr/share/man/man9| less



More information about the mdlug mailing list