Some Basic UNIX Commands
Some Basic UNIX Commands
by Donald Hyatt
The UNIX operating system has for many years formed the backbone of the Internet, especially for large servers and
most major university campuses. However, a free version of UNIX called Linux has been making significant gains
against Macintosh and the Microsoft Windows 95/98/NT environments, so often associated with personal computers.
Developed by a number of volunteers on the Internet such as the Linux group and the GNU project, much of the open-
source software is copyrighted, but available for free. This is especially valuable for those in educational environments
where budgets are often limited.
UNIX commands can often be grouped together to make even more powerful commands with capabilities known
as I/O redirection ( < for getting input from a file input and > for outputing to a file ) and piping using | to feed the
output of one command as input to the next. Please investigate manuals in the lab for more examples than the few
offered here.
The following charts offer a summary of some simple UNIX commands. These are certainly not all of the commands
available in this robust operating system, but these will help you get started.
Ten ESSENTIAL UNIX Commands
These are ten commands that you really need to know in order to get started with UNIX. They are probably similar to
commands you already know for another operating system.
Once you have mastered the basic UNIX commands, these will be quite valuable in managing your own account.
1. grep <str><files> grep "bad word" * Find which files contain a certain word
2. chmod <opt> <file> chmod 644 *.html Change file permissions read only
chmod 755 file.exe Change file permissions to executable
These are ten commands that you might find interesting or amusing. They are actually quite helpful at times, and
should not be considered idle entertainment.
7. cal <mo> <yr> cal 9 2000 Print calendar for September 2000
10. mpage <opt> mpage -8 file1 Print 8 pages on a single sheet and send to printer (the font will
<file> | lpr be small!)
These ten commands are very helpful, especially with graphics and word processing type applications.
9. m-tools (mdir, mcopy, mdir a: DOS commands from UNIX (dir A:)
mdel, mformat, etc. ) mcopy file1 a: Copy file1 to A:
These ten commands are useful for monitoring system access, or simplifying your own environment.
3. alias alias lls="ls -alF" Create new command "lls" for long format of ls
4. xhost xhost + threat.tjhsst.edu Permit window to display from x-window program from
xhost - threat
Allow no x-window access from other systems
5. fold fold -s file1 | lpr Fold or break long lines at 60 characters and send to printer
6. tar tar -cf subdir.tar subdir Create an archive called subdir.tar of a directory
tar -xvf subdir.tar Extract files from an archive file