This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.

UNIX commands »

Contents


Basic Unix Commands

Control characters

  • [ctrl C] - kill job

  • [ctrl D] - end of file

  • [ctrl Q] - continue output

  • [ctrl R] - redraw current command line

  • [ctrl S] - stop output

  • [ctrl U] - erase to beginning of line

  • [ctrl Z] - suspend current job

Commands

  • cat file1 - print the contents of file1 onto the terminal screen.

  • cd dir1 - change directory to dir1. cd with no argument changes back to the user's home directory.

  • chmod - change protection of files. chmod o-r file1 makes file1 unreadable to people outside of the owner's group. See man chmod for more details.

  • cp file1 file2 - make a copy of file1 and call it file2.

  • compress huge_file - conserves disk space. uncompress huge_file restores original file condition.

  • date - print the current date and time.

  • find - find files that match certain characteristics. For example, find . -name test.tex -print searches down through all your directories to find files named test.tex and will print their path names when it finds them. see man find for more details.

  • finger user - look up information about the named user

  • grep word file1 - look through file1 for word.

  • grep -l word * - look through all the files in the current directory and print the names of those files which contain word.

  • gsu groupname - change to group account.

  • head file1 - print the first 10 lines of file1.

  • jobs - show any background jobs.

  • kill %1 - kill background job number 1.

  • leave 1030 - reminds you (at 10:25) that you have to leave at 10:30.
    Note: there is no colon in the command line.

  • lpr - prints a file. See man lpr for usage or man lpq or man lprm for related commands.

  • ls - list the names of all the files in the current directory.

  • ls *.tex - list all the files that have the extension tex.

  • man prog - read the prog manual page. See man for more information.

  • man -k print - list all programs that deal with printing.

  • mkdir tex - create a new directory named tex.

  • module - allows you to manipulate environment variables needed for software packages. See Using Modules in ICS for usage.

  • more file1 - look at file1 one page at a time. Press the space bar to see another page, the return key to see another line. Type q to quit.

  • mv file1 file2 - change the name of file1 to be file2.

  • passwd - change your password (do this periodically!).

  • ps -ef - list all your current processes under Solaris (aka SunOS 5.X). For SunOS 4.X, do ps x. See ps for more info.

  • pwd - print the current working directory.

  • quota -v -displays the quota you have available.
  • rm file1 - delete file1.

  • spell file1 - list spelling errors in file1.

  • telnet hostname - connects you to a remote system

  • w - list who is logged on and what (if anything) they are doing.

  • wc file - count lines, words, and characters in a file.


Unix Dot Files

Files like .cshrc and .login are called "dot" files because a period precedes the name of the file. They are mainly configuration files and will not show up in an ls listing unless you type ls -a, hence they are also called "invisible files". If you are unable to login, something may be wrong with one of your dot files. Please visit Missing Unix "." Files - Here's How To Add Them . If this does not solve your problem, please send mail to helpdesk@ics.uci.edu.

.cshrc

There is a file in your "home" directory called .cshrc. It is executed before .login and contains commands that personalize your working environment.

.login

Your .login file is executed each time you log in and sets things like your terminal type to provide you with the same programming environment every time you log in. .login contains commands to make your files secure. You should not change this file unless you are sure of what you are doing. You can contact the student consultants at Eng. Gtwy E 1140 for more information.


Additional Resources