Uppsala University main webpage
Signals and Systems at Uppsala University, Sweden
Signals and Systems Group Staff Descriptions of all our research areas Publications, in html, pdf and postscript Undergrad  courses and PhD programs News and Events


USEFUL BASIC UNIX KNOWLEDGE

Signals and Systems Group, Uppsala University  

General Commands

find Find files

grep Search a file for a pattern

sort Sort or merge files

bash GNU Bourne-Again SHell.

Process control

ps  Report process status.
    -a     Select all processes except process group leaders and processes not associated with a terminal.
    -e    Select all processes.
    -l    Show columns flags, state, uid, pid, ppid, cpu, intpri, nice, addr, sz, wchan, tty, time, and comm, in that order.
    -f    Show columns user, pid, ppid, cpu, stime, tty, time, and args, in that order.

    Look for matlab processes (for example) only:
    ps -alef | grep matlab
     

kill Terminate a process.
    The kill command sends a signal to each process specified by a pid process identifier.  The default signal is SIGTERM, which normally terminates processes that do not trap or ignore the signal.

    Options:

    -9    Kill hard (can not be ignored by the process).
     

    Kill process 6135 (given by ps for example):
    kill 6135
     

top Display and update information about the top CPU processes on the system.

Disk stuff

ls List contents of directories.
    Options:
    -l  List in long format, giving mode, number of links, owner, group, size in bytes, and time of last modification for each file
    -a List all entries; usually entries whose names begin with a period (.) are not listed.
cp Copy files and directories.
    Options:
    -R Copy recursive (needed if you want to copy directories).

du  Summarize disk usage.

    List all files in current directory and sort in ascending order:
    du -s * | sort -n
df  Report number of free file system disk blocks (i.e. check disk space availble on disk).
    df -tk .

Viewing text files

more Veiw text files in a terminal window.

less Less is a program similar to more, but which allows backward movement in the file as well as forward movement.

Viewing manual pages

man Find manual information about unix commands. Example: man emacs, shows the manual pages for the emacs text editor.

info For reading Info documents about unix commands. Uses a simple menu driven text interface. Example: info emacs


FTP

ftp File transfer program.

gftp  X Windows frontend to ftp.
 


Math

matlab

xmaple


Text Pocessing

emacs GNU project Emacs.

xemacs

latex/tex Structured text formatting and typesetting.


Graphic Tools

xv  A multi-format image displayer for X Windows. Good for saving screen dumps in different formats etc.

gimp  The General Image Manipulation Program (like Photoshop).

xfig  Facility for Interactive Generation of figures.


Printing

lpr Off line print.
    Options:
    -Pprinter

    Note 1: If you want to cancel a printer job goto: http://signserv.signal.uu.se

    Note 2: To set the default printer add export PRINTER=floor2@signserv to your .bashrc file (type ls -a in your home dir if you can't find it).

    Note 3: If you have a PS-file and want higher quality when printing on the color printer color2, try adding the following lines at the beginning (in the %% part) of the ps-file :

    %%BeginFeature: *MediaType Glossy

    <</InputAttributes <<
        currentpagedevice /InputAttributes
    get
        dup 1 known exch 0 get dup length
    dict copy
        dup /MediaType (Glossy) put
        exch {1 exch dup}if 0 exch >>
      /MediaType (Glossy)
    >>setpagedevice
    <</TraySwitch false>> setpagedevice
    %%EndFeature

    %%BeginFeature: *OutputMode HighQuality

    <</PostRenderingEnhance true
    /PostRenderingEnhanceDetails
    <</PrintQuality 3 /Type 11>>
    >> setpagedevice
    %%EndFeature


    PostScript

    Viewing PostScript files


    gv -fg black -bg white file.ps &
       Options :

      -fg Foreground color.
      -bg Background color.
       

    Text to PostScript Conversion

    a2ps file.txt > file.ps
      Options:

      -1 single page mode.
      -p Print files in portrait mode (horizontal pages).

      Example: convert all m-files in a directory to PostScript and put them in a single ps-file.

      a2ps -1 -p *.m > m_files.ps
       

    Put n-pages on one page

    mpage  Print multiple pages (text or PostScript) per sheet on a PostScript printer or to a file.

     psnup -2 a_file.ps a_file2.ps
      Options:

      -n n-pages (PostScript) on each page. Hint: Good if you wan't put several PostScript slides (overheads) on one page to hand out to students.
       


webmaster@signal.uu.se | Updated Feb. 6 2002 (FL) | www.signal.uu.se/Info/Unix.html