Professional Documents
Culture Documents
Linux Command Quick Reference Page
Linux Command Quick Reference Page
File Management
ls
ls -s
Gives you a listing of your files along with their size in kilobytes.
Gives you a "long listing," which means that your files will be
shown in one vertical column and the file size and file access modes for all
files will be shown.
ls -l
All of these switches can be combined, so one might type ls -as to list all
of one's files and find their size.
cp
mv
Examples:
mv ~/myoldfilename ~/mynewfilename
mv file* ~/mydirectoryoffiles/
mv ~/mydir/ ~/myotherdir/
rm
rm mytxtfile.txt
rm rf ~/mydir/ (removes
rm rf ~/ (don't do this!)
pwd
Prints the working directory. This could be called your current path or view.
cd
mkdir
rmdir
Removes (deletes) a directory. You can only use this on empty directories.
Usage: rmdir [directory path and name]
Examples:
rmdir ~/olddir
rmdir olddir/empty/
du -k
Lists all files and folders with their associated total sizes in KiloBytes.
Usage: du k [directory path or file]
Examples:
du k (from current directory)
du ks ~/.mozilla (displays sum of all files' sizes in your mozilla tree)
uquota -w
Displays your current disk and print quota usage. The w option allows you
to see work directory quotas as well.
Usage: uquota w
scp
See description under Remote Access. Copies files or directories from one
user account to another.
chmod
ln s
/bin/rm
-rf
It's just like above, except you won't get the very data saving confirmation
messages if you're deleting many files.
An alternative is to unalias rm which will use /bin/rm until you logout.
Program Management
man
The man Linux tool is shorthand for "manual." Most Linux programs and
utilities have brief documentation installed on the system. In order to access
these online manuals,
apropos
There are many types of files that are commonly used in Linux systems that
may never be seen by an individual that is only familiar with Windows. The
"apropos" utility is a helpful tool for finding the proper utility or application
that opens a particular file type. Note that apropos may not be aware of all
filetypes.
Usage: apropos [file type]
(where [file type] is the file's extension)
Example: apropos pdf
Note: This utility currently works correctly only on linux workstations.
top
The top utility displays a list of the top ten (default number) programs
running ordered by how much cpu or computing power the programs are
using. A user can stop programs that they started from this screen by pressing
'k' then entering the Process ID (first column number) and pressing enter. In
order to quit top simply press 'q'.
ps
kill
Printing
lpr
can be used to print ONLY postscript or flat text files from the command
line or from within an applications print dialog.
lpr
Examples:
lpr
lpr
lpr
lpr
mpage
-Pdcllas1@print myfile.ps
-Pel252-bwd1@print myfile.ps
-o sides=one-sided myfile.ps
mytextfile
acroread
The Acrobat Reader allows users to view and print PDF files. It can be
invoked by typing acroread from the command line.
Usage: acroread
Once acrobat is running, the file to be viewed can be chosen by clicking File
and Open. Scroll up and down the list to find the desired file, and click on
that file to open it.
gv
pq
Print Queues are used to print your job after it has been spooled to the
printer. pq is used when printing on the Linux computers.
Usage: pq
Remote Access
ssh
insecure channels.
Usage: ssh [username]@[workstation name]
where [workstation name] is the name of the remote workstation and
optional [username] is the username you wish to login with.
Examples:
ssh remsun (on the ews network using your current username)
ssh janedoe@remsun.ews.uiuc.edu (outside the ews network
with netid
janedoe)
For more information regarding remote access including X11 forwarding
refer to http://www.ews.uiuc.edu/clrtxt/
sftp
The sftp utility is the secure version of ftp and works almost identically. Ftp
is a file tranfer protocol that allows you to upload and download files to a
computer running an sftp server (all EWS machines do as part of ssh access).
Usage: sftp [workstation name] or sftp [username]@[workstation name]
(Similar to the ssh command)
For more information about ftp commands and transfering files, see this
concise command reference or others.
scp
Copies a single file or a folder with multiple files using secure protocol over
TCP/IP (the network) from one computer to another. This is rarely useful
within the EWS environment, since your home directory is mounted on all
workstations. However, it may be useful to copy to another machine on or
off campus that runs an ssh server.
To copy one file from a remote workstation to your workstation
Usage: scp [remote workstation name]:[file name] [local path]
Where [local path] is the location where you wish to save the copied file (the
location . is your current location). Similarly, to copy one from your
workstation to a remote workstation
Usage: scp [local file name] [remote workstation name]:[path]
To copy an entire folder as above respectively
8
telnet
rlogin
rsh
rcp
rdist
These remote access methods are unsupported. These methods do not use
encryption and therefore are not part of EWS's commitment to using secure
communication. See http://www.ews.uiuc.edu/clrtxt/ for more information.
Common Tasks
Mozilla
FireFox
lock files
When mozilla firefox exits abnormally such as when mozilla firefox exits
unexpectedly due to a programming bug, a lock file can sometimes be left
behind causes the mozilla firefox profile that was used to become unusable.
Run this command to remove any lock or .parentlock files:
Use: ews-reset-firefox
Running a second time will delete the entire firefox profile including any
bookmarks, etc.
getskel
The getskel utility reloads the default shell and X windows configuration
to your account. Use this in case changes have been made to your
configuration files that are causing problems.
Use:
/usr/local/ews/getskel
Note: This will erase any customizations you have added to your startup
files.
webperm
This utility is an easy way to ensure that permissions on your web space files
are correct. Simply run this utlity and the permission on all files and
directories in your ~/public_html folder are set correctly.
Using disks
and cdroms
Before you can access your disk, you must first mount it. To do this, place
the disk in the drive and from the Linux prompt type volcheck . The machine
will check for any new disks and mount them appropriately. The files on the
mounted disk will be found in either /floppy , /zip , or /cdrom . When
you have finished using a disk, the following should be used on the
appropriate disk type to eject it.
Usage: eject-cdrom
or: eject-floppy
or: eject-zip
10