Absolute path: The path is written "must be from the root directory/write", for example:/usr/share/doc this directory.
Relative path: The path is written "not by/written", for example, by/usr/share/doc to the bottom of/usr/share/man: CD. /man
The absolute path is used: The correct degree is higher, and the absolute path is recommended when writing a program management system.
The use of relative road strength: It is convenient to switch long directories.
Operation Commands for Directories:
CD Change Directory switch directories
PWD Print working directory displays the current directory-p displays the actual path
mkdir make directory-m set directory permissions directly mkdir-m 711 Test2
Create a new directory-p recursively create a directory mkdir-p Test1/test2/test3/test4
RmDir Delete an empty directory-P together with the upper "empty" directory also deleted
Rmdir-p Test1/test2/test3/test4
-R Delete all contents of the directory Rm-r test
. Represents the current directory
.. Represents a previous level directory
-Represents a previous working directory
~ Represents the home directory where the "current user" resides
~account represents the user's home directory (account is a name)
The variable that executes the file path $path
See what directories are defined? Echo $PATH
LS Viewing files and directories
-A All files include hidden files
-l List Detailed properties Ls-l = ll
Ls-al list the properties of all files in the directory including hidden files
CP Copy Copy
CP Source File Destination file
-I if the target file exists asking whether to overwrite
-a The copied file is exactly the same as the source file properties =pdr
RM Remove to delete a file or directory
-F force forcibly removed without prompting
-R Delete all content in the directory
MV Move moves files or directories or renames
-F force forcibly moved without prompting
-U target exists and the source file is newer before it is updated
Get the file name Basename/etc/sysconfig/network
Get Directory name Dirname/etc/sysconfig/network
View Archive Contents
Cat starts with the first line
TAC starts with the last line
NL Show and lose travel number
More rows in a row display
Less row display, and can page forward
Head's just a few lines.
Tail only look at the tail a few lines
OD binary mode read data
Linux learning -04-file and directory management-1