Becoming Familiar with Unix commands
Boiled down:
obsidian.sru.edu |
logging in ssh |
man |
echo |
command line and arguments |
PATH variable |
changing password |
passwd |
who |
date |
which |
whereis |
ls |
pwd |
cat |
whatis |
apropos |
-- help |
tab keys |
arrow keys |
Must knows
- The machine is obsidian
- obsidian.sru.edu - accessible via Internet
- ID -- same as Univ. e-mail
- password - same as Univ.
- Bash shell
- lpr is print command
- man is the command for help (manual pages)
Keyboard commands for Bash (Table 2.4, page 49)
- ctrl-c: Interrupt
- ctrl-u: linekill
- tab: filename completion
- ctrl-d: exit
Filenames
- any number of characters
- any number of extensions
- case sensitive
First Commands
- To list files in your home directory - ls
- To determine current working directory - pwd
- To display the contents of a file on the screen - cat filename
- To print the contents of a file to the printer
- To get help on a command - man command
- To get help determining a command that does xxx --man -k xxx
- Editing - Real Unix people use vi
-
- Point and click people use that other thing
Command format
- Command space options
options begin with a hyphen -
spaces between options
- ls -l -a
- If the command line contains wildcards
- Substitute whatever matches first
- * and ?
- If the command line contains redirection
- Change where the input comes from or where the output goes to
- > < and |
- Also >> << &>
- Keyboard buffer
- Buffer - just an array of characters
- Special keys like enter, ^c, ^h (backspace) and ^z are handled immediately
More Commands
- echo $PATH
Generally linux assumes you are referring to your current working directory, pwd
But for commands, linux searches in each directory that is part of your PATH
It stops on the first match
- echo -n
- which
- whereis
- type
- printf instead of echo
- printf "string %s" $VARIABLE
- %s is place holder for string; value of variable inserted
- mailx user
- script
- You will use this command to log your work - assignments
- who
- w
- whoami
- uname
- -r current release
- -n machine name
- stty -a
- date
Dual Boot
X Windows
- xterm
- CDE - Common Desktop Environment
- Title bar
- Scroll bars
- Buttons
- Icons
- Pull Down Menus
- Minimize
- Maximize
- X Applications
- Xterm - start a terminal
- xload - watch CPU load
- xeyes - track the mouse
- xcalc
- xwd - store a screen image
- xpr - print an image created by xwd
- xman
- xwininfo - find out geometry of a window
All work herein is subject to copyright. Original content to Dr. Deborah Whitfield, text content (Your UNIX/Linux) to Prentice Hall publishing.