Basic Unix Survival Information
Basic Window Survival
- An
xterm is your basic command line--a terminal
window
- Scroll Bars
- The root menu (left-click the desktop)
- Moving/Resizing Windows
- Iconifying/Restoring Windows
- Resizing
- Middle-Clicking
- The "Window Operations" menu
General Format of Unix Commands
% <command> [<options/args>] [<files>]
Examples:
ls
ls -l
ls -l myfile
ls -ld mydir
ls -l -d mydir
Getting Help On-Line
- For a particular command, type:
% man <command-name>
- For all commands on a general topic:
% man -k <keyword/topic>
Command Line Tips
- We are using "ksh" as our command shell.
- Normally, command line is in vi "insert mode",
<Delete> key deletes previous character.
- <escape> switches to vi "command mode".
- Use h/l keys to move left/right in line (command mode).
- x/X deletes character under/before cursor.
- To insert/append text, type i/a <text> <escape>.
- <return> executes edited command line.
- To recall previous commands for
editing/re-execution, use <escape>, then k/j keys.
- Default command prompt includes machine name
and current working directory name for reference.
- As you learn about vi, many of its editing functions
will also work on the command line (some to try:
w, W, b, B, e, E, dw, de, D, 0, A, etc.).
Other Command Line Features
- Typing <escape>\ will cause the shell to try to complete
the file or program name you are currently typing.
- Typing <escape>= will instead list all possible
completions that are available at the current cursor
position.
- Typing <escape>* will insert all possible file name
completions on the command line.
New Account Environment
- New accounts are tailored with some basic settings to
make things easier.
- Many MS-DOS commands will work through "aliases".
- Type "
alias" to see all aliases.
- Commands with arguments can be aliased:
alias ls='ls -F'
.
- Other features are tailored through environment variables.
Navigating Through Directories
pwd -- print current (working) directory
cd <dir> -- change directory to <dir>
cd ~- -- change to previous working directory
ls [<dir>] -- list directory contents
cp <src> <dest> -- copy file(s)
mv <src> <dest> -- move file(s)
rm <file> -- remove file(s)
rmdir <dir> -- remove directory(s)
mkdir <dir> -- make directory(s)
cat <file> -- display file contents on standard output
more <file> -- display/browse one page at a time
Other Helpful Commands
which <command>
- Searches your command path for the given command,
telling you which directory (if any) it is found in.
whereis <command>
- Asks the operating system where common places to
keep commands are, and searches them for the given
command; on some Unix versions, will also uncover
manual pages, source files, etc.
L. T. Watson
<ltw@cs.vt.edu>
Last modified: Sat Aug 16 17:57:31 EDT 1997