CSci223 - Spring 2005

Command-line UNIX


Getting Information - man

The man command allows you to get lots of information on commands, standard C functions, etc. Just type man name, where name is the name of the command or function you are trying to get information on. Try man man for more information on man. Try running man on any of the commands mentioned below.

Listing Files - ls

To list the files and directories in your current directory, type ls. To see files in another directory type ls directory. For instance, ls /usr/include/ will show all the files and directories in that directory. To get more information on files, such as permissions, ownership, size, and last-modified time and date type ls -l.

Changing Directories - cd

To move into another directory, use the cd command. cd is not a command in the same sense that ls is a command. cd is actually built into the shell, not a separate program, so there is no man page entry for it. To move into another directory type cd dirname. To get back to your home directory, just type cd with no arguments.

Unpacking Archives - tar

UNIX-like systems have several methods of archiving files, but "tarring" is probably the most popular method. "Tarballs" that are compressed with gzip typically have an extension of tar.gz or tgz. To unpack on of these tarballs, use the command:
tar -zxvf filename.tar.gz

Downloading Files from the Web - wget

To download a file from the web, type wget url. This will download the file in the URL to your current directory.