Useful tips - Linux                                                                        Kenji Hamano

Last modified : Jul04, 2005                                              Back to How To      Back to Home


Boot up as single mode
     > a
     > [space]single
     > /etc/init.d/network start
     > /etc/init.d/xfs start
     > /usr/X11R6/bin/X -query fate-1.phys.uvic.ca

Text mode => graphic mode
     > [Alt][F7]
Graphic mode => text mode
     > [Ctrl][Alt][F1]

Force to kill processes and logout
     > [Ctrl][Alt][Backspace]

Terminate current process
     > [Ctrl]c
Stop current process
     > [Ctrl]z
and put it into background
     > bg 1
put it back to forground
     > fg 1
Suspend background process
     > stop 1
Kill background process
     > kill 1


Others
     > host fate-1.phys.uvic.ca
     > ssh khamano@mercury2.uvic.ca
     > ssh -l khamano mercury2.uvic.ca
     > scp filename khamano@noric02.slac.stanford.edu:~/releases/BToDlnu-a24/workdir
     > scp tince@mercury2.uvic.ca:~/filename khamano@fate-1.phys.uvic.ca:~/workspace/tmp


     > lp -Phepcolor filename

     > gv filename.ps/.eps/.pdf
     > ggv filename.ps
     > acroread filename.pdf
     > xpdf filename.pdf

     > latex filename.tex (tex->dvi)
     > dvips -o filename.ps filename.dvi (dvi->ps)
     > pdflatex filename.tex (tex->pdf)

     > gzip filename
     > gunzip filename

     > tar -cvf outputFilename inputFilename1 inputFilename2 inputFilename3
     > tar -xvf filename (to extract)
     > tar -tvf filename (to see the contents)

     > fs listquota
     > fs listacl

     > df
     > du (disk usage)

     > top
     > ps (to see shell)
     > ps -aux | grep [letters]

     > alias new-command='existing-command'
     > alias ll='ls -al'
     > unalias new-command

     > find start-directory -name filename -print (to find a file "filename")
     > rm -rf directory
     > cp -r directory location

     > cat -n filename (show line number)
     > cat -tv filename (show non-printing charactors)
     > cat file1 file2 > outfile (add two files into outfile)
     > grep "hi there" filename
     > grep '[0-9]' filename (lines containing number)
     > grep '^I' filename (lines beginning with "I")
     > fgrep '^I' filename (lines containing "I")
     > head -20 filename
     > tail -40 filename

     > chmod 1777 directoryname or filename (add files but cannot remove or modify)
     > chmod 1766 directoryname or filename

     > eps2esp
Convert eps to pcx
     > gs -sDEVICE=pcxmono -sOutputFile=filename.pcx -r300 filename.eps
Convert pcx to eps
     > pcxtoppm < filename.pcx | ppmtopgm | pgmtopbm -threshold | pnmtops -rle -noturn > filename.ps