UNIX Commands
UNIX Commands
This is a summary of UNIX commands. This is only the basic command list to help you
navigate through a UNIX system.
Check out this
SITE for a more detailed
introduction to UNIX.
Directory Structure
/dir1/dir2/dir3/file
File is in directory dir3, which is a subdirectory of dir2, which is a subdirectory of
dir1, which is a subdirectory of the top-level directory, / (root).
. current directory.
.. parent directory-directory directly above the current directory.
dir1/dir2 relative pathname-directories below the current directory.
Wild Cards
- ? matches exactly one character.
- * matches zero or more characters.
- [ ] matches any of the characters within the square brackets.
Command Options
The most basic command syntax for a command is: command [arg1][arg2]...[argn].
Commands can have options, usually preceded by a "-", which modify the command. The syntax
is:
command -ab..m[arg1][arg2]...[argn].
These options may also have arguments. The option arguments precede the command
arguments. The syntax is:
command -ab..m[arga][argb]...[argn].
The table below is a listing of useful UNIX commands that will make file manipulation
easier for mosaic or Netscape applications. These commands are only useful on UNIX computers.
Directories
pwd
Description: shows working(current) directory
Example: pwd
mkdir
Description: makes a directory
Example: mkdir directory
rmdir
Description: remove an empty directory
Example: rmdir directory
cd
Description: changes working directory to dir d
Example: cd assign1
ls
Description: list the filenames in dir d
Note that you can have multiple arguments
for the list command.
Example: ls -ab..m
Files
rm
Description: remove file or files from the directory
Example: rm file [...filename]
cp
Description: copy file 1 to file2 or to another directory,
keeping the same filename
Example: cp file1.ext file2.ext
mv
Description: move or rename file1 to file2
Example: mv file1.ext file2.ext
cat
Description: display contents of file, or catenate
contents of file to file2
Example: cat file1.ext file2.ext
Networking
telnet
Description: interactively login to remote node
Example: telnet oak.grove.iup.edu
ftp
Description: transfer files between login node and remote node
Example: ftp avocet.ma.iup.edu
rlogin
Description: interactively login to remote UNIX node
Example: rlogin egret
rcp
Description: copy to a remote UNIX node. This will copy file1 on node n1
file2 on node n2. If n1 or n2 are missing,
the node is assumed to be the login node
Example: avocet: /usr/users/assign1/outfile
Editors
vi
Description: invoke visual or screen editor on document1
Example: vi document1
Emacs
Description: invoke emacs editor on document1
Example: emacs document1
pico
Description: invoke pico editor on document1
Example: pico document1
Help
man
Description: display UNIX on-line manual page about command
Example: man rm