Basic UNIX Commands
Unix (officially trademarked as UNIX, sometimes also written as Unix with small caps) is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna. Today the term “Unix” is commonly used to describe any operating system that conforms to Unix standards, meaning the core operating system operates similarly to the original Unix operating system. Today’s Unix systems are split into various branches, developed over time by AT&T as well as various commercial vendors and non-profit organizations.
| UNIX command | Definition |
|---|---|
| ls | Shows the contents of a directory |
| pwd | Shows the current directory |
| cd | Changes directory |
| vi | Invokes the editor |
| cp | Copies a file |
|
Example: |
cp trades.07.dat trades.dat |
| mv | Moves a file and keeps its date and time stamp information |
| ls –lt | Shows full information about a file |
| chmod | Changes permissions on a file |
|
Example: |
chmod 777 trades.dat |
| UNIX command | Definition |
|---|---|
| rm | Deletes a file |
| mkdir | Creates a directory |
| cat | Allows user to view a file |
| more filename | Displays the first page of a file-hit enter to display one more line or-hit spacebar to show one more page |
| tail filename | Shows last page of a file |
| tail filename 500 | Show last 500 lines of a file |
| tail –f filename | Does a continuous tail. Leave your telnet window up and whatever updates the running process is making to the file will be displayed |
| grep | Finds a pattern |
|
Example: |
grep analytical_cash.txt EUR |
| | | Pipe. Allows the user to apply a command after the pipe to the results of whatever command came before the pipe |
|
Example: |
autorep –j ptr% | grep FA |
| > | Redirects the output of the command in front of the > to a job results text file |
|
Example: |
autorep –j ptr% > trjobs.txt |
| ps –ef | Lists all active processes |
|
Example: |
ps –ef | grep |
| History | Shows a numbered list of all the commands you’ve entered in the current session |
| !3 | Runs the command from the history list numbered 3 |
| !! | Repeats the previous command |
| Exit | Logoff |
| df -lk /rootname | Allows you to see the % allocation for a root directory |
| du /rootname | Shows the disk usage of sub-directories for a root directory |
Related posts:








Leave your response!