Linux Basic Command operations
Basic commands for directory and file management
1 Viewing and switching directories:
PWD: View current directory,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image002 "border=" 0 "alt=" clip_image002 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiol1zpg3ph4hszaaagugniht8419.gif "" 244 "height="/>
CD: Switch working directory,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image004 "border=" 0 "alt=" clip_image004 "src=" http://s3.51cto.com/wyfs02/M01/77/8D/ Wkiom1zpg3szp1r6aaamdqvkbgg924.gif "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image006 "border=" 0 "alt=" clip_image006 "src=" http://s3.51cto.com/wyfs02/M02/77/8D/ Wkiom1zpg3sby4ykaaaqxnah-nu948.gif "" 244 "height=" "/>
LS: List shows directory contents,
LS can view information of multiple files at the same time
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image008 "border=" 0 "alt=" clip_image008 "src=" http://s3.51cto.com/wyfs02/M02/77/8D/ Wkiom1zpg3wh90kcaaaj4tz0jri854.gif "" 244 "height="/>
Ls–ld: Displays only the detailed properties of the current directory, not the contents of the directory,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image010 "border=" 0 "alt=" clip_image010 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiol1zpg3xsrzn_aaajeo-hlko658.gif "" 244 "height="/>
LS–LH: View two files in a long format that is easier to read,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image012 "border=" 0 "alt=" clip_image012 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiol1zpg3bwoeskaaaoiys5gcw077.gif "" 244 "height="/>
The/etc/directory is listed in long format starting with "NS". Conf "End of file information,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image014 "border=" 0 "alt=" clip_image014 "src=" http://s3.51cto.com/wyfs02/M01/77/8C/ Wkiol1zpg3abacv6aaan2etfn5c892.gif "" 244 "height=" "/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image015 "border=" 0 "alt=" clip_image015 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiol1zpg3ey_finaaae5qhcely067.gif "" Height= "/>"
Du: Statistics directory and the space occupancy of files,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image017 "border=" 0 "alt=" clip_image017 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiol1zpg3fwhu8naaahs6hesxg455.gif "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image019 "border=" 0 "alt=" clip_image019 "src=" http://s3.51cto.com/wyfs02/M00/77/8E/ Wkiom1zpg3ecq8ecaaaizexqcxi570.gif "" 244 "height="/>
2 Creating directories and files:
Mkdir: Create a new directory,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image020 "border=" 0 "alt=" clip_image020 "src=" http://s3.51cto.com/wyfs02/M01/77/8E/ Wkiom1zpg3jspppgaaae4ka4h-y977.gif "" "Height="/>
L-P: Create nested multi-level catalogs at once
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image021 "border=" 0 "alt=" clip_image021 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiol1zpg3jgloafaaafqopnnme566.gif "" "Height="/>
Tiuch: Create an empty file,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image023 "border=" 0 "alt=" clip_image023 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiol1zpg3mqop41aaauog-3ujg884.gif "" 244 "height="/>
Ln: Creating a linked file
L-s: Creating a soft connection, explicitly specifying it,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image025 "border=" 0 "alt=" clip_image025 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiol1zpg3qytgihaaapg22blyc038.gif "" 244 "height="/>
Configure script system-config-network for the NIC to establish a hard connection file named Netconfig.
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image027 "border=" 0 "alt=" clip_image027 "src=" http://s3.51cto.com/wyfs02/M02/77/8E/ Wkiom1zpg3rtwzm6aaalo9goc8i458.gif "" 244 "height="/>
Copy Delete move directory and file:
CP: Copy files and directories,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image029 "border=" 0 "alt=" clip_image029 "src=" http://s3.51cto.com/wyfs02/M01/77/8C/ Wkiol1zpg3qgobntaaaj25q6mnu693.gif "" 244 "height="/>
L-r: Copy the data including the full directory,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image031 "border=" 0 "alt=" clip_image031 "src=" http://s3.51cto.com/wyfs02/M00/77/8E/ Wkiom1zpg3uyir95aaakssmikjy931.gif "" 244 "height="/>
RM:---Delete files or directories,
L-RF Direct Delete without prompting,-I: Remind user to confirm when deleting files and directories
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image032 "border=" 0 "alt=" clip_image032 "src=" http://s3.51cto.com/wyfs02/M00/77/8E/ Wkiom1zpg3vdmwxdaaae4p3xyt0325.gif "" "Height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image033 "border=" 0 "alt=" clip_image033 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiol1zpg3yhnq-waaaeytztvsm038.gif "" "Height="/>
L MV---Move files or directories,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image035 "border=" 0 "alt=" clip_image035 "src=" http://s3.51cto.com/wyfs02/M01/77/8E/ Wkiom1zpg3yaq9ogaaapwxd-89i109.gif "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image037 "border=" 0 "alt=" clip_image037 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiol1zpg33islhiaaam3gpopdu691.gif "" 244 "height="/>
3 Finding directories and files:
Which----find the Linux command file and show where it is
L can find a command alias named LS located in the/bin/ls command program file, look for the internal command CD will be prompted in the search path does not have this program file,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image039 "border=" 0 "alt=" clip_image039 "src=" http://s3.51cto.com/wyfs02/M02/77/8E/ Wkiom1zpg32cdteqaaaw_u9o0_s229.gif "" 244 "height=" "/>
Find----Locate a file or directory,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image041 "border=" 0 "alt=" clip_image041 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiol1zpg3_j2tvzaaajy0i4yr4085.gif "" 244 "height="/>
When multiple find conditions need to be used simultaneously, the logical operator "-a" can be used between expressions and "-O" or
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image043 "border=" 0 "alt=" clip_image043 "src=" http://s3.51cto.com/wyfs02/M00/77/8E/ Wkiom1zpg3_qn4r8aaaqwc_tble810.gif "" 244 "height="/>
4 commands to help get information
L Use the man help option to see Find; The Help information for the command,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image044 "border=" 0 "alt=" clip_image044 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiol1zpg4djsah0aaaeal3vwug384.gif "" "Height="/> "
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image046 "border=" 0 "alt=" clip_image046 "src=" http://s3.51cto.com/wyfs02/M01/77/8E/ Wkiom1zpg4dcwon1aaa4hrqebus692.gif "" 244 "height=" 123 "/>
L Use the Man tool to view the man's manual information and save it as a mantxt text file.
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image047 "border=" 0 "alt=" clip_image047 "src=" http://s3.51cto.com/wyfs02/M02/77/8E/ Wkiom1zpg4gybqrpaaaelam01ly327.gif "" "height=" "/>"
L Use the Man tool to view the wget download tool, the data Date display tool's manual album information,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image049 "border=" 0 "alt=" clip_image049 "src=" http://s3.51cto.com/wyfs02/M01/77/8C/ Wkiol1zpg4gaduv1aaayeoo6huk423.gif "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image051 "border=" 0 "alt=" clip_image051 "src=" http://s3.51cto.com/wyfs02/M02/77/8E/ Wkiom1zpg4linw5qaaafvdgxgj4475.gif "" 244 "height=" one "/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image053 "border=" 0 "alt=" clip_image053 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiol1zpg4kd22xeaaafoefgvoq051.gif "" 244 "height=" 118 "/>
L View System directory/sbin/bin/usr/bin/usr/sbin,
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image055 "border=" 0 "alt=" clip_image055 "src=" http://s3.51cto.com/wyfs02/M00/77/8E/ Wkiom1zpg4oye7olaaagon_wxba964.gif "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image057 "border=" 0 "alt=" clip_image057 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiol1zpg4pq9t0zaaalcrwqb7i134.gif "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image059 "border=" 0 "alt=" clip_image059 "src=" http://s3.51cto.com/wyfs02/M01/77/8C/ Wkiol1zpg4txdpz8aaapeh7y4lu659.gif "" 244 "height="/>
Linux Basic Command operations