Home » Resources » Linux » Unix 101
Unix 101 (01)

'Unix is not so much an operating system as a way of thinking.' - Old Computer Science Proverb
Where You Find Stuff
As Unix has only one file system root, all physical drives must be mounted under that same root, most often farther down the hierarchy tree. [Removable media also sort in this way.] It's quite common to have the most essential files on the primary drive: This might be the only drive accessible at boot, as the system files themselves must see that all additional drives are mounted as the boot proceeds.
There are as well a number of standard directories found right under root which might be interesting to look at.
| /bin | Can often contain most of the executables ('binaries') used in the basic system setup. |
| /etc | Contains the passwd file and later derivatives. |
| /usr | Often a separate drive mounted onto the primary drive, this directory can begin the tree for user-specific files. Sub-directories such as /usr/bin are common. |
The actual operating system files might be found either in the root itself or in one of its direct sub-directories.
Common Command Stuff
Now a look at more basic Unix commands.
mv
mv is the move command: It's an actual executable file which takes care of moving files from one directory to another. As with MS-DOS systems, moving normally does not entail moving the file itself, but only its references. The only time mv will actually deal with file copying is when the source and destination are not on the same physical disk.
cp
cp is the copy command: It will actually perform a physical file copy. The file will exist in two separate places.
rm
rm is the remove command and is used for deleting files only.
chdir/mkdir/rmdir
chdir changes your working directory; mkdir makes directories; and rmdir removes them.
pwd
pwd prints your working directory (on your screen).
ln
ln creates an additional link to an existing file (an additional file name in a directory).
file
Lists the contents of a directory and attempts to figure out what file types these files have. As Unix does not rely on file extensions to determine file type, the existence of 'magics' in these files (as also found in Microsoft files) becomes all-important.
Unix Honchos
The BPOC on a Unix system is the superuser or root. Traditionally this is user 0 in user group 0, although security may be tighter on your box and be configured a bit differently. The superuser will have access to everything on the system even though this person's login is governed just as any other.
Basically any user defined as user 0 in user group 0 will have the same status, and just as with the file system, user names need not be unique.
In the early years of Unix all the user login information was contained in the file /etc/passwd. This proved far too easy to crack as time went on, necessitating more and more sophisticated schemes. Dennis Ritchie personally constructed 4,096 faulty variations of DES for use here.
When first a user was created, the system chose one of these, encrypted the user's password, and put both in /etc/passwd. As the algorithms were deliberately 'faulted' the process was not reversible.
(Don't laugh: IBM mainframes all the way up to but not including MVS/XA - the mainstay of the computing world for almost thirty years - used a simple one-on-one encryption system which was reversible. Cracking a user account took a matter of seconds.)
Users of stand-alone Unix boxes can operate as the superuser if they wish; however this is normally not to be advised, especially not when connected to the Internet. Processes created by the superuser account carry the same status and may ease the ability of intrusion programs to access the system.
Next »
|