such as creating filesA.txt:$ cat > A.txt #Redirecting standard input to a filemondaytuesdaywednesdaythursdayfridaysaturdaysunday^c$ Cat B.txt #Show file Contentsmondaytuesdaytuesdaythursdayfridaysaturdaysunday$ head-3 a.txt #View Start3Linemondaytuesdaywednesday$ tail-f a.txt #View a growing number of files for log viewingmondaytuesdaywednesdaythursdayfridaysaturdaysunday^c$ Sort A.txt #Sortfridaymondaysaturdaysundaythursdaytuesdaywednesday$ uniq B.txt #Remove Duplicate Rowsmondaytuesdaythursdayfridaysaturdaysunday$ diff-u a.txt b.txt #Compare files,- uShow Different---a.txt 2012-03-08 15:34:00.340179508 +0800+++ b.txt 2012-03-08 15:41:12.404569605 [email protected]@ -1,6 +1, 6 @ @MondayTuesday-wednesday+tuesdaythursdayfridaysaturday$ file A.txt #Viewing file informationa.txt:ascii text$ grep-in--color sat *.txt #find a string,- I.Case insensitive ,- NShow Line NumbersA.txt:6:saturdayb.txt:6:saturdaygrepcommand can be used on a single file- Halways show file names, which can be used for directories- RRecursive lookup. Several utilities have several commonly used such asEcho,Dateand other commands to complete some daily operations. $ date--rfc-3339=s # =datewill only show the date2012-03-08 15:59:57+08:00Compressed ArchiveLinuxThere are many kinds of compression tools, the most common isgzipand thebzip2. General useTarfiles or directories are archived and compressed directly, and they can be used separately. $ tar czf w.tar.gz a.txt b.txt$ tar xzf w.tar.gz$ tar cjf w.tar.bz2 a.txt b.txt$ tar xjf w.tar.bz2generally put throughTarArchive and then directly compress the package named. Tar. XXform, to distinguish it from the individual compressed. GZand the. bz2file. Find command to determine if a command exists, you can use thewhichcommand to find out if it is in the search path, but itDebianThe user does not have command to execute permissions, you can use theWhereisfind on a larger scale. You can also useLocatein the entire file system lookup, it can find any type of file. Locatedatabase is typically made up ofUpdateDBcommands are generated at timed intervals.
5.8 pm Outside Classes Linux