LIS 525 - Unix and Linux
Unix is an operating system used on many mainframe computers,
There are also distributions
suitable for smaller computers,
such as FreeBSD.
A version of Unix forms the basis of Apple's Mac OS X.
looks very similar to Unix to the user
and recognizes most of the same commands.
Linux is free and is distributed
under the GNU General Public License.
It was originally created by Linus Torvalds
and is being developed
with the assistance of people around the world.
A number of companies
(e.g., Debian, Red Hat, Slackware)
have developed their own distributions of Linux,
each with its own feature set,
some available at no charge via FTP,
and others purchasable on CD,
or as a companion to a Linux book.
Some computer suppliers sell workstations
with Linux preinstalled.
Note that all commands, file names, and passwords
in Unix and Linux
are case sensitive
(in OS X, file names may or may not be,
depending on configuration).
The root directory is /
(forward slash, not \ as in DOS or Windows).
Each user's files are typically in a subdirectory
with the same name as the user's login name.
Some confusion can be created, however,
because Unix/Linux files also have "owners",
who may not be the same as the owner of the directory
in which the files appear.
When users log in,
they are normally automatically put initially
in their own directories.
A single period (.)
represents the current directory in commands
represents the directory immediately above
in the hierarchy.
(change your password)
(display directory contents)
- ls -l
(option for providing extended/long listing)
- ls -a
(option for displaying all/hidden files)
- mkdir newdirectory
- cd somedir
(change directory to somedir)
- cp source destination
(copy file from source to destination)
- Example: cp /home/mnelson/page4.html
(copy page4.html from M. Nelson's directory
to the current directory)
- rm filename
- rmdir directory
(delete empty directory)
- rm -R directory
(delete directory and its contents)
- more filename
(display the file on the screen, stopping after each page)
- chmod [ugoa...][[+-=][rwx] file
(change file access permissions)
- u user, g group, o other, a all
- + grant permission,
- revoke permission,
= set current permission to be the only permission
- r read, w write, x execute
chmod a+r index.html
(allows everybody to read index.html file)
- Instead of the letter codes
you can use a set of three numbers.
The first number is the protection for the user,
the second for the group, and the third for others;
r = 4, w = 2, x = 1.
chmod 755 index.html
means the user can read, write, and execute (7 = 4+2+1)
but the group and others can only read and execute (5 = 4+1).
press "q" to exit)
For More Information
Last updated October 31, 2007.
This page maintained by
Prof. Tim Craven
E-mail (text/plain only): email@example.com
Faculty of Information and
University of Western
Canada, N6A 5B7