Unix PDF
Unix PDF
What is Linux?
Linux is a UNIX system Free Open source Developped in 1991 by Linus Torvalds There are several Linux distributions:
Red Hat Fedora SuSE Mandrake Debian Ubuntu
cd dirname --- change directory. cd .. will get you one level up from your current position cd without arguments will send you to your home directory, like cd ~ cd ~/tmp = cd /home/magali/tmp pwd tells you where you currently are. 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. du h --- human
Finding things
find:
find name refine-settings.pam find name *.pam find name vol0?.spi
grep string filename(s) --- looks for the string in the files:
starbuck 675% grep grploop refine.pam ; grploop <a href="./grploop.pam">grploop.pam</a> ; grploop/smangloop returns [stop] @grploop([ang-step],[ang-limit],[radius],[alignsh],[prjradius],[iter],[grp],[stop],[maxspfreq]) OR
Job control
List your processes:
top ps ef: to see all the processes ps ef | grep magali: to see magalis processes See man ps for more
Launch a executable
The file you call must have the execution rights. If not, youll have an error message. Notion of default path:
If you call spider, it will launch it although you dont have a local copy. Why so? Either because it is defined by your PATH (environment variable):
% which eman /usr/local/EMAN/bin/eman
From a local copy: example: you want to launch SPIDER in your current directory:
% ./spider spi/dat
Generalization: the system must know the path of the file you want to execute
transfers:
sftp magali@156.111.6.184, then put/get scp (-r) files machine:path scp *.pam 156.111.6.184:/usr10/magali
Example: connect and transfer files on the master node of the cluster
Connect with ssh -X magali@156.111.6.1977 Check the disk space: /home/magali> df -h ./ Filesystem Size Used Avail Use% Mounted on /dev/sdc1 2.2T 1.3T 985G 56% /master.raid Check the space usage of your files: magali/Master_cluster> du -hs ctftilt 262M ctftilt Transfer files from the cluster to your computer: scp r Xlk 156.111.6.46:/space Note: to log on a node from the master node: % rsh node42
Miscellaneous
whoami --- returns your username. Sounds useless, but isn't. You may need to find out who it is who forgot to log out somewhere date --- shows the current date and time. Archiving: tar
tar tar tar tar cvf myarchive.tar *.pam cvzf myarchive.tar.gz *.pam xvf myarchive.tar xvzf myarchive.tar.gz
File Compression:
gzip filename --- Produces filename.gz gunzip filename --- uncompresses files compressed by gzip. compress/uncompress: .Z format zip/unzip: .zip format