Terminal shell commands

There is a lot of information inside the “manual” man pages for almost every Unix shell command. Also most commands suggested here should work on a (ssh) secure shell environment.

At CCRMA the shell of choice is the C-shell. There should be a .cshrc file in your home directory and familiarity with its meaning can be really helpful on getting acquainted with the behavior of your terminal window. You can write scripts or shortcuts which can be stored on your .cshrc file and therefore this means that you can have your own shell commands. You can find more information in the man pages or in gnu-help or simply, gnu A good source for information and tutorials on Unix commands can be found at, Unixhelp If you have read the Unix section of this guide you will find the following commands 'very' useful:

- General and file manipulation commands:

Command Description
man
Get information or help about a command
apropos
Locate commands by keyword look up
ls
List directory contents
pwd
Path of working directory
cd
Change working directory
mv
Move file or change name
cp
Copy file
mkdir
Make directory
rm
Remove files and directories
mount /mnt/zip
Mount zip disk on directory /mnt/zip

- Commands for printing:

Command Description
lpr file.ps
Print in the default printer (knoll)
lpr -P np2 file.ps
Print in the trailer's printer
lpq
Show printer jobs in the queue
lprm
Remove the last job submitted if it is in the queue
lprm -np2 25
Remove job 25 in spool queue np2

WARNING !!! PLEASE, DO NOT use the lpr command to print Adobe Acrobat “pdf' files or postcript definition files. Open Acrobat Reader instead and print from within inside Acrobat Reader or use the command pdf2ps to convert to a “ps” postscript file.

- Postcript utilities:

As a wonderful ecological solution suggested by Julius Smith and to save some trees the following commands will let to print two pages in one from a postscript file. You type:

psnup -n 2 infile.ps > outfile.ps

psnup -pletter -n 2 infile.ps > outfile_2up.ps

To print an A4 formatted document you need to re size it to the American standard “letter-size”. For this, you use the command psresize in the following way:

psresize -PA4 -pletter infile.ps > outfile.ps


- Synchronize a directory:

Suppose you have moved contents of one your local directories to CCRMA's “/zap” directory and make changes to one of the files in the “/zap” directory. To synchronize or update your changed file to the original file in the original directory, you use the 'rsync' command as follows:


         rsync  -av /zap/dir/ $\sim$/dir/       

To update or synchronize just a file:


         rsync -av /zap/yourfile $\sim$/dir/yourfile       


- Connectivity and file transfer and text manipulation:

Command Description
finger
look for all ccrma users
finger login@
look for particular user
ssh
secure login on remote machine
scp
secure file copy from or to machine
talk login@cmnXX
talk to other user on this terminal
find
look for file
cat
output contents of a file
grep
search for a string of text

- Editors and publishing:

Command   Description
vi
  text editor
emacs
  development text editor
latex
  compile a LATEXfile
dvips
  convert a dvi file to postscript
ps2pdf
  convert a ps file into a pdf file

- Account Administration:

Command Description
chmod
change permissions on files and directories
yppasswd
change password

© Copyright 2001-2022 CCRMA, Stanford University. All rights reserved.
Created and Mantained by Juan Reyes