Linux file and directory Management 1, some of the more special directories, need to write down hard. represents the current layer directory. represent previous directory- represents the previous working directory (this is a good cock!) Other basic know) ~ represents [current user identity] Home directory ~account represents account this user's home directory 2, directory-related commands a) CD: Transform directory B) PWD: Show current directory * not cooked mark -P can get some link addresses out c) mkdir: Create a new directory D) rmdir Delete a Empty directories * non-RIPE tags, note: Only empty folders 3, most commonly used files and directory monitoring ls  -A Show All files equivalent to all -A with-a No The same thing is not to show. and.. two -F ls default sorting is arranged according to the document name order, after adding the unordered display -F to the file, the 弽 and other information, give additional data structure, for example: *: On behalf of the executable file;/: Represents the 弽; =: Represents the socket file; |: Represents the FIFO file; H will file size by K M G and other display, compare humanization -I display inode number, inode meaning, I also temporarily Phuket -L Long data data, including file attributes and permissions data (common) -n lists UID and GID instead of user and group name -R Reverses the result data equals reverse -R along with Subdirectories are listed together, equal to all the documents in the directory are displayed -s for file size sorting -T Sort by archive time, not the file name's most recent start sort --fulL-time Show Details time 4, copy, delete and move CP RM mv 5, view document contents One-time display cat tac NL Part of the show Mo Re less data intercept head tail Cat knows, TAC is fun, actually cat upside down, and it works as well, backwards output &nbs from the end of the document P NL (add line number printing) can add the output file content to the line number! Its pre-OU results are not cat-n a bit too, NL can be more than the line number of display OU, including the number of bits is not self-completion 0 and so on. more space Bar (space): Represents a Page down; &N Bsp enter: On behalf of "one line"; /string: In this display of the content, the search for "string" Keywords;  :F: Show the file name immediately and the number of lines currently displayed; &NBSP Q: The representative immediately leaves more, no longer show the contents of the file.  B ring [Ctrl]-b: The representative of the page back, not this just useful for the file, the pipeline useless. less and more have the same function, but in addition to page up and down PageUp PageDown   search/ ? Head (remove previous lines) tail (take the next few lines) Touch Modify file time ring build new file:Touch [-ACDMT] Profile option no parameter:-A: Only revise access time,-C: Only modify the file, if the file does not exist do not create a new file;-D: You can follow the date you want to revise, and you can use the--date= "date ring time"-M : Modify only mtime; t: can be changed later to change the time and not use the current time, in the format [YYMMDDHHMM] file Pre-ou permissions: Umask umask is led set "the current user in the establishment of the file ring 弽 when the permissions default obituary value" Example: Umask return 0002 (or umask-s) means 777-002 =775 This is a folder, if it is a file, the default is 666 so it should be 664. Set the current user to establish the file default value: Umask 0002 followed by the model. Chattr (Profile hidden property) lsattr (Show profile hidden properties) Watch file type: Files which (find "execution file") [[email protected]tmp]$ which ifconfig
/sbin/ifconfig
[[email protected]tmp]$ which cat
/bin/cat
The last example is the most interesting, allowance CD this commonly used led order to find Ah! Why is it? This is because the CD is "bash built led order"! But which pre-OU is to find the PATH within the yingying Fan 弽, so you must find the AH! What about the allowance? Never mind! We can make it through type LED! Whereis (looking for a specific file)
So what is Whereis using? Why is the search so much faster than find corporate? Actually, there's nothing there! This is because the Linux system will be all the files in the system 弽 in a database file, and the Whereis to use the locate is the next to say that the contents of the database will be based on the content, therefore, you will find the use of these two files, you will find the file has been killed! And Hideaway also can't find the latest files that have just been created! This is because the two led orders are the result of database bi search for files! Locate is related to the Linux archive database (the Linux system will keep all of the files in the system 弽 in a database file) This locate is easier to use and you can get results after you enter the "file part name" directly behind. Bowl above example 杢 said, I input locate passwd, then in the full file name (package ton path name) in the just to have passwd in it, will be displayed 杢! This is also a vigilance easy to use LED order, if you forget the full file name of a file ~ ~
Brother Bird's Linux Private Cuisine Foundation Third Edition read note two