some tips for the GNU/Linux user ================================ a good source of information: www.cs.huji.ac.il/support/unix_intro.ps man --- $ man // manual page for str / str // look for a string in the man page n // look for the next one $ info // an alternative to man file system ----------- [tab] completion of filename/directory mv,rm,cp,mkdir. $ ls -l // long format $ ls -a // hidden files $ls -la // both recursive: cp -r ex1/ ex1-backup rm -r ex1-backup/ rm -rf ex1-backup/ //no questions - dangerous. absolute path / relative path /cs/stud/moti or ../../ex2/ $ pwd // print the path of the current directory search the file system for a file: find / -name "yosi*" -print regular expressions ------------------- ~ - home directory * any string (also empty) ? - one character [abc] - one character a b or c [a-v] - one character in range {str1,str2} - one of the strings. examples: $ echo *{ab,fg}* $ ls *.c $ ls q2.* $ ls [OoPpq]*.[dc]* `command` - execute command and expand to its output. $ echo the current directory is `pwd` command history --------------- $ history // prints the command history ! // re-execute a history command by its number. !! // execute last command archive ------- archive a directory: tar czvf ex1.tgz ex1/ extracting a directory (structure is kept): tar xzvf ex1.tgz processes --------- ps u // all processes of the user ps x ps ux ps uxf ps uxfa kill -9 number symbolic link -------------- $ ln -s labc/ex1/checks cur // like shortcut in windows environment variables $ setnev // list all environment variables and their values $ set // same on bash $ echo $USER $ echo $PATH $ setenv myVar stamValue $ setenv PATH ${PATH}:. $ echo $SHELL // which shell am I currently using ? telnet - working on your account from home. ------------------------------------------- $ telnet gw.cs.huji.ac.il or: $ telnet and then: $ open gw.cs.huji.ac.il enter login enter otp $ connect inferno // or mangal or any other cs server enter login enter regular password. ftp - transferring file from/to home. $ ftp gw.cs.huji.ac.il // or ftp and then open gw.cs.huji.ac.il enter login enter otp user login@inferno enter regular password get // cs --> home put // home --> cs cd // change directory at cs lcd // change directory at home.