Basic Unix User Commands

Option arguments are in brackets [ ], and user supplied arguments are italicized. REMEMBER, unix
commands are CASE SENSITIVE!!!!!
File Operations
- ls [filename]
Basic list of files in the current directory (non-hidden files), or the specific filename (if provided).
Other options/switches you can use with this are:
-l long list (same as ll command below)
-a all files, including hidden files (those that start with ".")
-t list files in date order (newest files first)
-tr list files in reverse date order (oldest files first)
-R recursive list of all files and any files in subdirectories
- ll
Long list of files in the current directory, with information such as date, size, ownership, protection, etc. included. Options listed for the ls command (above) may also be used here.
pico [filename]
Edit a file using the Pico (Pine) editor (system default editor).
mv [oldfilename newfilename]
rename a file in Unix. The mv command also can move a file into another directory
file filename
The system's best guess as to what type of file it is. Wildcards permitted.
less filename
Display the contents of a file on the screen, page by page with the additional ability to use vi editor commands to move UP and DOWN through the file. (space to page down, "b" to go back a page)
cat filename
Display the contents of a file on the screen - NO PAGE BREAKS
^p, ^n
Recall previous command (^p) and next command (^n)
To edit the line within the recalled command you must use the cursor control
sequences for backward (^b) and forward (^f) instead of the arrow keys
Users and User Maintenance Functions
- cd "directory name"
The cd command changes your current working directory to the one specified
in "directory name". Using ".." moves you up one directory in the directory hierarchy.
If no directory is specified then cd will move you to your home directory.
e.g. cd/bin <RETURN> would move you to the "/bin" directory.
e.g. cd..<RETURN> would move you to the previous directory, for instance
to "/finearts/home" from "/finearts/home/fflinstone".
e.g. cd <RETURN> would move you to your home directory.
exit
Logs you out of the system if you are at the system prompt
passwd
Allows you to change your password. It will prompt for the old password, and prompt for
the new one twice. Unix passwords can be a MAXIMUM of 8 characters, and can include special
characters. Passwords are CASE SENSITIVE! Good passwords should include combinations
of upper/lower case letters and/or numbers or special characters such as $, %, @, ^, (, etc.
who
See who is currently logged into this system
grep -i username /etc/passwd
Search Falcon to see if a specific user's account has been created
grep pattern filename
Search a specific file(s) for the specified pattern. If the pattern contains
special characters, enclose it in quotes "". Wildcards are permitted in the filename.
(example: grep -i davi /etc/passwd) The -i disables the case sensitive search.
finger [name]
List a particular user or person if a userid or name is given (must be currently logged in), and if
no arguments are given, list all users currently logged into this system.
the .profile file
The .profile file is a hidden file that contains user-settable options and commands that are executed
each time the user logs in. It is comparable to the DOC autoexec.bat file, or the VAX/VMS login.com file.
To customize your login environment, you may modify this file.
Manipulating Text in Unix
- There are several text editors available to the Unix user on Falcon. The most commonly known and easy to use is "Pico".
The following commands are efficient ways to select blocks of text and move them around in your document while in Unix.
-
- Cntrl - Shift - 6
-
- To highlight or select blocks or lines of text .
-
- Cntrl - K
-
- To cut the highlighted text.
-
- Cntrl - U
-
- To uncut or "paste" text.
Space Usage
- quota -v
Report on your disk space usages and quotas
du
Report disk usage, summaried by subdirectory
Printing
- lp filename [filename filename ...]
Print the specified file (or files) to the default system printer. Other options/switches you can specify with this are:
-dprintername printer destination, where "printername" is the print
queue where you want it printer. Include it after
the "-d", with NO SPACES (ex: lp -dmiller_hp4 myfile )
-n## number of copies to print (ex: lp -n3 myfile)
for more information on the lp command, see the man pages.
- lpstat -p
Displays a list of valid print queues, and their status. NOTE: Some of these printers are
restricted to certain users only
Using the lpstat command with no arguments (leave off the -p) will give you information about any jobs
you have pending in those queues, but can take a long time to finish executing.
Changing your default printer
To change your default printer so it is set each time you login, you must edit your .profile
file (see above) and add the lines listed below. Be sure to use UPPERCASE/lowercase as noted below.
LPDEST=printername
export LPDEST
Applications
- menu
User menu. New users get this menu by default, but if you quit the menu to the system prompt, you can get back
into the menu with this command. To set your environment so that you do NOT get the menu when you first login, modify
your .profile file and remove this command from the bottom.
mail [address]
Electronic mail. If an address is specified, you are put into the editor in Pine to compose a message to that person.
If no address is specified, you enter the mail utility menu.
ph [firstname] [lastname]
Ph client to lookup directory information about people, etc. If you don't know the spelling, you can use wildcarding,
like c* mill* for the names. The server will not return more than 25 entries, so you may need to choose a more specific search, such
as ca* millst*.
Online Help
- man [section#] commandname
Look up a specific command in the online Manuals. This will give you all the options/switches available
for the command, and the proper syntax for its use. Manuals are grouped into sections, and if the command is
located in a specific section, you may have to include the section number in order for the man command to find
it. If you don't know the command name you are looking for, use the keyword search option instead - see below.
man -k keyword
Use a keyword search of the manpages to find all commands pertaining to that topic.