Linux file and directory management learning summary

1. The absolute path "must start from the root directory /"; the relative path "does not start from /"

2. There are special directories . .. ~ - -account, you need to pay attention

3. The commands related to the directory include cd, mkdir, rmdir, pwd and other important commands

4. rmdir can only delete empty directories. To delete non-empty directories, use rmdir -r

5. The commands that the user can use are searched according to the directory specified by the PATH variable

6. Different avatars (root and general users) have different default PATHs

7. ls can view the properties of the file, especially -d -a -l and other parameters are particularly important

8. The copying, deleting, and moving of files can be operated by cp, rm, mv and other commands respectively.

9. Commands that can be used to view the content of the file (read the file) include cat, tac, nl, more, less, head, tail, od, etc.

10. Both cat -n and nl can display line numbers, but by default, blank lines will be numbered differently

11. The purpose of touch is to modify the time parameters of the file, but it can also be used to create an empty file

12. There are three kinds of time parameters recorded in a file, namely access time (atime), status time (ctime), modification time (mtime), and ls displays mtime by default.

13. In addition to the traditional rwx permissions, in the Ext2/Ext3 file system, chattr and lsattr can also be used to set and view hidden attributes. Common ones include +a which can only add data and +i which cannot be changed at all.

14. The new file/directory is, the default permission of the new file is standardized by umask, the default directory full permission is drwxrwxrwx, and the file is -rw-rw-rw-

15. When the file has the special permission of SUID, it means that when the user executes the binary program, the user will temporarily have the permission of the program owner during the execution process.

16. When the directory has the special permission of SGID, the file user group newly created by the user in this directory will be the same as the user group name of the directory.

17. When the directory has the special permission of SBIT, it means that only the user and root can delete the files created by the user in the directory.

18. To view the file type, you can use the file command to view

19. The full file name of the search command can be used which or type, both of which use the PATH variable to find the file name

20. To find the full file name of the file, you can use whereis or locate to the database file to find it without actually finding the file system

21. Using find, you can add many parameters to directly query the asking price system to get the file name you want to know.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326763080&siteId=291194637