110 likes | 257 Views
CIS 240 Introduction to UNIX Instructor: Sue Sampson. CIS240 – Miscellaneous. Displaying contents of compressed files: zcat <options><filelist> cat test1.doc.gz $@test1.doc.t.lzv[sue@localhost testzip] zcat test1.doc.gz I’m testing this again… Mutiple pages?
E N D
CIS 240 Introduction to UNIX Instructor: Sue Sampson
CIS240 – Miscellaneous Displaying contents of compressed files: zcat <options><filelist> cat test1.doc.gz $@test1.doc.t.lzv[sue@localhost testzip] zcat test1.doc.gz I’m testing this again… Mutiple pages? Use: zmore <options><filelist>
CIS240 – Miscellaneous Searching for Files: find command: Searches a list of directories that meet the criteria, searches recursively. (all subdirectories are also searched) If no directory is listed, starts in current directory. find directory-list expression Common criteria: -name pattern searches for matching files -print display pathnames of found files -user name search for files owned by name -inum N searches for matching files, useful for finding all the hard links to a file
CIS240 – Miscellaneous $ find –name test3.doc -print ./testtar/test3.doc ./testres/test3.doc ./testzip/test3.doc $ find ~ –name test3.doc -print ./testtar/test3.doc ./testres/test3.doc ./testzip/test3.doc $find /usr . –inum 308375 –print ./sue/memo.txt ./sue/memo.hard
CIS240 – Miscellaneous Searching for Commands: whereis command: Searches for a specific command, provides absolute path, allowing you to update your path statement. whereis [options] [filelist] Options: -b Search for binaries (exe’s) only -m Search for manual page on -s Search for source code only
CIS240 – Miscellaneous $ whereis ftp ftp: /usr/bin/ftp /usr/share/man/man1/ftp.1.gz $ whereis –b cat cat: /bin/cat $whereis find compress tar find: /usr/bin/find /usr/share/man/man1/find.1/gz compress: tar: /bin/tar /usr/share/man/man1/tar.1.gz
CIS240 – Miscellaneous Command History: history command: commands typed in at console are saved in a history list. The history command is used to display or manipulate the list. SET command is used to determine location and size of the history file, history [options] [filelist] Options: N Display only the last N commands -c Clears the history list -w [filename] Write the current history list to the file
CIS240 – Miscellaneous $ set … … HISTFILE=/home/sue/.bash_history HISTFILESIZE=1000 **number of commands saved between sessions HISTSIZE=1000 **number of commands allowed in file … $ history … 487 whereis find compress tar 488 history 489 java –version 490 set $ history 2 489 java –version 490 set
CIS240 – Miscellaneous Installing Packages: rpm: -- The RPM Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer software packages. -- .rpm packages are available from a number of sites… Getting to gcc: ftp://ftp.openpkg.org/release/1.3/ Installing java tutorial: http://home.bredband.no/gaulyk/java/tutorial/javaredhat.html RPM tutorial:http://linuxexperience.com/articles/redhatrpm.php
CIS240 – Miscellaneous Installing Packages: rpm [install-options] [package-file] Options: -v print routine progress information -h prints hash marks as install progresses -i install -U upgrading existing packages -e uninstalls package -- log in as root -- move to directory containing .rpm file -- rpm -i
CIS240 – Miscellaneous Installing Packages: -- log in as root -- move to directory containing .rpm file rpm –i gcc-3.3-1.3.0.ix86-linux2.4-cw.rpm