Unix 5-Week Bundle: Review for Midterm 1
Unix 5-Week Bundle: Review for Midterm 1 COP 3353
Popular in Intro to Unix
verified elite notetaker
Popular in Department
This 14 page Bundle was uploaded by Annette Marin on Wednesday February 3, 2016. The Bundle belongs to COP 3353 at Florida State University taught by Melina Vastola in Spring 2016. Since its upload, it has received 202 views.
Reviews for Unix 5-Week Bundle: Review for Midterm 1
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/03/16
Week 1 Notes: Intro to UNIX 2/3/16 4:57 PM Making a CS Account: First type: ssh firstname.lastname@example.org Host name: shell.cs.fsu.edu Username: newacct Password: newacct Can now log into LOVE building wifi (CSusLan) using CS credentials linprog commands: users – shows all users on machine ls – lists (like a main menu) pico/nano – vi – emacs – Problems creating CS account? Email: email@example.com or MCH208 Week 2 Notes: Pico & Nano 2/3/16 4:57 PM Pico/Nano Text Editor, then: TONS OF UNIX COMMANDS!! Machines: shell ß linprog1-4 ß linprog2.cs.fsu.edu Diablo program1-4 Pico/nano >pico myfile.txt ^ = ctrl ^K = cut ^u = paste ^o = saves ^x = quits command flags parameters ls ß list contents of a directory flags: -a shows all contents even hidden -l longer listing w/ detailed info _____________________________________________________________ mkdir spongebob makes directories cd ß change directories rmdir ß removes EMPTY directories cd ~ ß go back to home directory touch man command to look up rm filename to remove file rm –r directoryname recursive rm –r * ß NO view contents of text files cat more ß space bar usage pages through less ß space bar ^v wc -l ß letter count -c ß character count -w ß word count emacs ^x^s = saves ^x^c = quits/close vi to go to: command mode: esc insert: i :w = save :q = quits :wq = save & quit :q! = quits no save Week 3 Notes: Pathnames, & more commands! 2/3/16 4:57 PM / bin home etc rimmer lister Kryten Hologram Ships Guitar Bazookoid Starbug Pathnames Absolute paths ALWAYS start with / Relative paths Cannot use / for filename or directory name .. = parent directory n = home . = current directory / = root Abs: Bin 1. /bin Guitar 2. /home/lister/Guitar Relative: Harbug 1. Starbug home 2. ../.. Guitar 3. ../Guitar rummer 4. ../../rimmer Ships Bazookoid 1. cd ../../Kryten/Bazookoid 2. cd /home/Kryten/bu---- cp _what you want to copy_ __where to copy to__ -i = prompt before overwriting! -r = recursive copy mv _what you want to move__ _where to move to___ n unix fsu.txt newdir bob filetxt fsu.txt Kyle WILDCARDS * a.txt apple.txt stuff.bak b.txt c.txt apply.txt stuffa.txt stuffb.bak thing.dat stuffc.rtf PLACE cp * PLACE cp /* PLACE cp n/* PLACE sal soccer S* s123 *.txt s m* m mom mooom mm moo.bam ?.txt .txt ß means must have 1 character before .txt ??? mom dad cow hat m[aei]t mat m?t met meet meat moot mit mut [A-Z].txt ?.txt [A-Za-z].txt 1.txt [a-c12].txt a.txt 1.txt [abc12].txt b.txt 2.txt c.txt M???[1-9].tx? Week 4 Notes: Review - Wildcards! 2/3/16 4:57 PM * ?  Write wildcard seq to match: fsu.txt Fsu.txt 1. Any file w/ a 1, 2, or 3 anywhere dog.txt1 in the filename cat3.txt dig.whatev 2. Any file that contains “Fsu” 22unix.awesome (upper or lowercase) plankton1.dat 3. Any file w/ 3 characters before a “.” in the filename. Answers: 1. ** 2. *[Ff][Ss][Uu]* 3. ???.* r = read w = write x = xcecute r w x | r w x | r w x owner (user) group other r – x | - w - | r - - chmod chmod ___7_____3____1____newfile.txt u g o read = 4 write = 2 execute = 1 rwx|-wx|--x rw-|---|r— 6 0 4 u + r g – w o = x chmod u – x directory chmod go+r chmod g+r,o+r same thing chmod u-x,g+r g+r,u-x r w- - - - - - - r w x r w - - - x uo+x,g+rw - - x – w x - w x u-rw,ugo+x,go+w u=x,go+wx r - x - w x r - ß current chmod u = w,g+r file a: - w - r w x - - chmod 1 1 1 file a: - - x - - x chmod ugo+rwx file r w x r w x r w x or 777 r w - - - - - - - chmod u+x file tar ***REQUIRES the use of flags*** Creating a tar file: tar –cvf mycode.Tar *.cpp *.h c ß create v ß verbose ß v is optional but nice to have there f ß name file Extract from tar file: tar –xvf mycode.tar xtract Week 5 Notes: Input & Output 2/3/16 4:57 PM Redirecting Standard Input: programName < file Redirecting Standard Output: programName > file Appending: programName >> file ß double arrows Command: whoami ß tells you who you are Redirecting both StdInput & StdOutput: command < input file > outputredirection can be used interchangeably command > outputredirection < input file as long as arrows point right direction Piping: programA > file programB < file programA | programB command | command command > file command < file diff: ** know for test ** ***only for contents of text files, not for directories*** Example: diff>diff fightsong.txfightsong2.txt 6c6 < For FSU is on the warpath now, --- > For fsu is on the warpath now, 6 means the line that the difference is on c means change Flags: -i ignore caps -b ignores space Another Example: diff>diff –I fightsong.txt fightsong2.txt 11a12 11 means the changed line 12 means the added line a means line was added 9d8 9 means file that was deleted d means deletion 8 means new file line since line was deleted How to read: # _ # line #’s add delete change grep: **know, but not on test** look it up on your own, not covered in class cmp & gzip: *cmp will probably not be on test at all
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'