click below
click below
Normal Size Small Size show me how
Unix Commands
Unix commands
| Question | Answer |
|---|---|
| Terminates the current Shell | exit |
| informs the shell you want to end the login session | logout |
| changes the working directory to Dir | cd Dir |
| Changes the current directory to the user's home directory | cd |
| Lists the contents of the current directory | ls |
| Creates a directory named Dir | mkdir Dir |
| Displays the full pathname of current directory | pwd |
| Outputs a list of previously entered command lines | history |
| Re executes the most recent command line | !! |
| Re executes the most recent command number ## | !## |
| Re executes the last command that begins with xxx | !xxx |
| tells the shell to interpret newname as command | alias newname command |
| advance one screen | spacebar |
| advance one line | ENTER |
| Go back to top of the file one screen | b |
| go forward to the first target | /xxx |
| Go to the next target | n |
| outputs file1 from beg to end | cat file1 |
| outputs the first 10 lines or the last 10 lines | head filename or tail filename |
| counts the lines words and chars in a filename | wc filename |
| copies file1 to file2 | cp file1 file2 |
| renames file1 as file2 | mv file1 file2 |
| deletes filename | rm filename |
| Asks you if you want to delete filename | rm -i filename |
| checks the spelling in filename | spell filename |
| displays users currently on | who |
| print filename on the line printer | lp filename |
| sends the output of the utility to the file filename | utility > filename |
| appends the output of the utility to the end of the file filename | utility >> filename |
| Displays manual | man |
| displays a lines in the table of contents containing any word listed in words | man -k words |
| Changes the users passwd | passwd |
| lists all the contents of the current directory | ls |
| lists a long listing of all te contents of current directory | ls -l |
| concatenates file1 and file2 outputs 1 then 2 | cat file1 file2 |
| searches for lines containing a certain word in filename | grep word filename |
| counts the line, words, and chars in filename | wc filename |
| prints the #th field of file | awk '{print $#}' file |
| displays lines in a file in sorted order | sort filename |
| checks spelling in a filename | spell filename |
| removes permission to read file | chmod -r filename |
| Gives permission to read file | chmod +r filename |
| grants execute permission on the file | chmod +x filename |
| removes execute permission on the file | chmod -x filename |
| executes a variable | $var |
| matches all filename | * splatt |
| interprets the next char as an ordinary char without speical meaning | \ |
| Turns off interpretation of all characters between the single quotes . seen as ordinary char | ' ' |
| Lists processes | ps |
| clears terminal screen | clear |
| location of utility name | which utitliyname |
| ypcat | network database files the way cat does local |
| reads arguments and writes them to output | echo |
| Moves cursor back | ? |
| moves cursor forward | /word |