File Manipulation
ls --- lists your files
ls -l --- lists your files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified.
ls -a --- lists all files, including the ones whose filenames begin in a dot, which you do not always want to see.
There are many more options, for example to list files by size, by date, recursively etc.
more filename --- shows the first part of a file, just as much as will fit on one screen. Just hit the space bar to see more or q to quit. You can use /pattern to search for a pattern.
tail --- Shows the last few lines of a file
emacs filename --- emacs is an editor that lets you create and edit a file.
pico filename --- pico is another easy to use text-editor.
mv filename1 filename2 --- moves a file (i.e. gives it a different name, or moves it into a different directory.
cp filename1 filename2 --- copies a file
rm filename --- removes a file. Using the option rm -i will ask you for confirmation before actually deleting anything.
diff filename1 filename2 --- compares files, and shows where they differ
wc filename --- tells you how many lines, words, and characters there are in a file
chmod options filename --- lets you change the read, write, and execute permissions on your files. For example, chmod o+r filename will make the file readable for everyone, and chmod o-r filename will make it unreadable for others again.
File Compression
gzip filename --- compresses files. Gzip produces files with the ending '.gz' appended to the original filename.
gunzip filename --- uncompresses files compressed by gzip.
gzcat filename --- lets you look at a gzipped file without actually having to gunzip it.
zip --- zip for IBM files.
tar --- combines multiple files into one or vice-versa.
Printing
lpr filename --- print. Use the -P option to specify the printer name if you want to use a printer other than your default printer.
lpq --- check out the printer queue, e.g. to get the number needed for removal, or to see how many other files will be printed before yours will come out
lprm jobnumber --- remove something from the printer queue. You can find the job number by using lpq.
genscript --- converts plain text files into postscript for printing, and gives you some options for formatting.
dvips filename --- print .dvi files (i.e. files produced by LaTeX). You can use dviselect to print only selected pages.
Directories
mkdir dirname --- make a new directory
cd dirname --- change directory.
pwd --- tells you where you currently are.
rmdir --- removes directory (rm -r to delete folders with files).
Finding things
ff --- find files anywhere on the system. This can be extremely useful if you've forgotten in which directory you put a file, but do remember the name. In fact, if you use ff -p you don't even need the full name, just the beginning.
grep string filename(s) --- looks for the string in the files.
About other people
w --- tells you who's logged in, and what they're doing. Especially useful: the 'idle' part. This allows you to see whether they're actually sitting there typing away at their keyboards right at the moment.
who --- tells you who's logged on, and where they're coming from. Useful if you're looking for someone who's actually physically in the same building as you, or in some other particular location.
finger username --- gives you lots of information about that user, e.g. when they last read their mail and whether they're logged in.
last -1 username --- tells you when the user last logged on and off and from where. Without any options, last will give you a list of everyone's logins.
talk username --- lets you have a (typed) conversation with another user
write username --- lets you exchange one-line messages with another user
elm --- lets you send e-mail messages to people around the world (and, of course, read them).
About your (electronic) self
whoami --- returns your username.
passwd --- lets you change your password, which you should do regularly (at least once a year).
ps -u yourusername --- lists your processes. Contains lots of information about them, including the process ID, which you need if you have to kill a process.
kill PID --- kills (ends) the processes with the ID you gave. This works only for your own processes, of course.
quota -v --- show what your disk quota is (i.e. how much space you have to store files), how much you're actually using.
df --- shows disk space available on the system.
du filename --- shows the disk usage of the files and directories in filename (without argument the current directory is used). du -s gives only a total.
last yourusername --- lists your last logins. Can be a useful memory aid for when you were where, how long you've been working for.
logout --- logs off system.
Connecting to the outside world
rlogin hostname --- lets you connect to a remote host
telnet hostname --- also lets you connect to a remote host. Use rlogin whenever possible.
ftp hostname --- lets you download files from a remote host which is set up as an ftp-server.
pine --- easy to use mailer.
lynx --- a textual World Wide Web browser.
Miscellaneous tools
date --- shows the current date and time.
cal --- shows a calendar of the current month. Use e.g., 'cal 10 1995' to get that for October 95, or 'cal 1995' to get the whole year.
bc --- a simple calculator.
man command --- shows help on a specific command.
make --- compiles source code.
gcc file.c --- compiles C source into a file named 'a.out'.
dos2unix file --- strips CR's out of dos text files.
unix2dos file --- adds CR's to unix text files.
Open the original version of this page.
Usablenet Assistive is a UsableNet product. Usablenet Assistive Main Page.