Linux
General useful commands
source ~/.cshrc
ls -la = list all directories and files & executeables
module avail - list's all the modules which are available in the system
module list - list's all the modules which one did install
ps -ef|grep ketter - list system resources
less log_hh.m | grep -A 1 .popShare --> search the file log_hh.m and print out all lines where the string .popShare is and one line after it (-A 1) if you want to print something out before, let's say one line give -B 1 instead
df -h - report file system disk space usage
du -h - estimate file space usage
quota - display disk usage and limits
Handling zip Files
gunzip file.gz
unzip file.zip
gzip -d file.gz
tar -xvf file.tar
tar -cvf file-name.tar ./directory-name
bzcat file.tar.bz2 | tar xvf -
tar -xzf filename.tgz
tar -zxvf filename.tar.gz
Search
Remote Access
ssh beo2 or remotely: ssh -l[username] machine
ssh username@machine.cs.umn.edu -C -X
rlogin name-of-machine
Latex and viewing
dvips -f file.dvi >! file.ps {convert dvi file into ps, and overwrite old file if necessary}
dvips -f file.dvi | lpr -P... - {convert dvi file into ps and pipe it to selected printer}
dvips -f ev.dvi | gv -landscape - &
psnup -4 -l file.ps >! file_4.ps {Convert a ps document into one that has four slides per page and in landscape format}
man ImageMagick
identify file.format
convert -density 85x85 -antialias tacscm.jpg tacscm.eps
dvips file.dvi
ps2pdf - converts ps-file to pdf-file
enscript -f Courier9 -p hw5_prob2.ps hw5_prob2.c -- print hw5_prob2.c to file hw5_prob2.ps with font Courier9
enscript -2rd<printername> <filename>
latex: latex file.tex --- bibtex file (without any extention, and only if there were changes made to the bibtex file) --- latex file.tex again
Permissions
chgrp group permission on particular file: e.g. chgrp magnet sales.log
change recurively from group ketter to group magnet: chown -R ketter.magnet *
set the group permission bit: chmod g+s .
groups - show all the groups one is in
chown ketter.ketter wolfstyle.css - change the group permission on wolfstyle.css to group ketter
chmod g-w * - remove for the group (g) the write permission for all files
chmod g=o * - set the group permission (p) to the same level as the permissions for the outside group (o)
chmod o-w * - remove for the outside group (o) the write permission for all files
chmod -R go-w * - recursively remove for the group (g) and the outside group (o) the write permission for all files
ls -ld .
CVS
Set up a CVS directory: 1) mkdir directory e.g. summitview 2) in the new directory: cvs -d/"Path to cvsroot" import -m "Created directory structure" [directory name] [username] [start tag] Example: cvs -d/project/condor06/usr/ketter/cvsroot import -m "Created directory structure" summitview wolf start 3) delete the newly created directory!!! 4) in parent directory: cvs -d/project/condor06/usr/ketter/cvsroot co summitview
1) mkdir tac-papers 2) inside the newly created directory: cvs -d/project/magnet01/cvsroot import -m "Created directory structure" tac-papers ketter start 3) rm -fr tac-papers 4) in parent directory: cvs -d/project/magnet01/cvsroot co tac-papers
How to create a separate cvs checkout directory in an already existing cvs directory. This is useful when people are just interested in one part, e.g. a paper, but not in all parts, i.e. the experiments or data that goes with it.
1. cd to the top-level directory you want to archive. If it's tac-scm/mlcode, then cd to tac-scm/mlcode. 2. cvs -d /project/tac/cvsroot import -m "comment" <project-name> <vendortag> <releasetag> where - /project/tac/cvsroot is the cvs repository. If you are doing it remotely, you'll have to use the :ext:ketter@larch... version. - <project-name> is the name of the directory you want to see when you do a checkout or update - <vendortag> is a string like "new" - <releasetag> is a string like "R1" 3. If project-name is the same as the name of the directory you are in, then you need to change the name of the existing directory in your workspace. So cd ..; mv mlcode mlcode-original 4. In tac-scm, do a cvs -d /project/tac/cvsroot co <project-name> If you are working externally use this instead: cvs -d :ext:<username>@<computer>.cs.umn.edu:/project/tac/cvsroot co <project-name> From then on, you can do commits and updates in the checked-out directory tree, and others will see it only if they do the checkout. If you don't want the cvs directory anymore simply go to the cvsroot directory and remove it, e.g.: /project/tac/cvsroot and do rm -rf d