Directory:
~ Represents the current user's home directory
. Represents the current directory
.. Indicates a parent directory
Link file
Use different filenames to refer to the same data or program for hard links
In the same physical file system, create a hard link
-bash-4.2$ Find ~-name "*.py" >mypylist
Ls-la indicates that all files in the current directory, including hidden files, are viewed in a long format, and each field has the following meanings:
The 7 segments are:
- File properties: Drwxr-xr-x
- Number of hard links or directory subdirectories: 3 (the field for an empty directory is 2, indicating that there are two subdirectories in the directory, because each directory has a subdirectory "." and a subdirectory that points to its parent directory ".") )
- Owner: User
- Owning user group: group
- File size: 102 byte
- Modification Time: Mar11 22:56
- FileName: filename
-bash-4.2$ Ls-la
Total dosage 151228
DRWX------. 6 MYHASPL myhaspl 4096 September 18 08:55.
Drwxr-xr-x. 3 root root 20 September 10 08:23..
-RW-------. 1 myhaspl myhaspl 1915 September 18:05 bash_history
Drwxr-xr-x. 9 MYHASPL myhaspl 4096 June 14:38 hadoop-2.4.1
-rw-r--r--. 1 myhaspl myhaspl 15417097 June 14:42 hadoop-2.4.1-src.tar.gz
-rw-r--r--. 1 myhaspl myhaspl 138656756 June 14:42 hadoop-2.4.1.tar.gz
-rw-r--r--. 1 myhaspl myhaspl 1454 September 10:53 mydoclist
-rw-rw-r--. 1 MYHASPL MYHASPL 88 September 17:25 MyList
-rw-rw-r--. 1 myhaspl myhaspl 357304 September 08:55 mypylist
-rw-rw-r--. 1 myhaspl myhaspl 31954 September 18:02 Myse
Drwxr-xr-x. 8 MYHASPL myhaspl 4096 September 10:39 numpy
DRWXR-----. 3 MYHASPL myhaspl 18 September 16:21. PKI
Drwxrwxr-x. Root root 4096 September 16:25 pypy-2.3.1-src
-rw-rw-r--. 1 myhaspl myhaspl 357304 September 17:57 SE
-bash-4.2$ LN mypylist mypylist1
-bash-4.2$ Ls-la
Total dosage 151580
DRWX------. 6 MYHASPL myhaspl 4096 September 18 08:56.
Drwxr-xr-x. 3 root root 20 September 10 08:23..
-RW-------. 1 myhaspl myhaspl 1915 September 18:05 bash_history
Drwxr-xr-x. 9 MYHASPL myhaspl 4096 June 14:38 hadoop-2.4.1
-rw-r--r--. 1 myhaspl myhaspl 15417097 June 14:42 hadoop-2.4.1-src.tar.gz
-rw-r--r--. 1 myhaspl myhaspl 138656756 June 14:42 hadoop-2.4.1.tar.gz
-rw-r--r--. 1 myhaspl myhaspl 1454 September 10:53 mydoclist
-rw-rw-r--. 1 MYHASPL MYHASPL 88 September 17:25 MyList
-rw-rw-r--. 2 myhaspl myhaspl 357304 September 08:55 mypylist
-rw-rw-r--. 2 myhaspl myhaspl 357304 September 08:55 mypylist1
-rw-rw-r--. 1 myhaspl myhaspl 31954 September 18:02 Myse
Drwxr-xr-x. 8 MYHASPL myhaspl 4096 September 10:39 numpy
DRWXR-----. 3 MYHASPL myhaspl 18 September 16:21. PKI
Drwxrwxr-x. Root root 4096 September 16:25 pypy-2.3.1-src
-rw-rw-r--. 1 myhaspl myhaspl 357304 September 17:57 SE
-bash-4.2$ LN mypylist mypylist2
-bash-4.2$ Ls-la
Total dosage 151932
DRWX------. 6 MYHASPL myhaspl 4096 September 18 09:27.
Drwxr-xr-x. 3 root root 20 September 10 08:23..
-RW-------. 1 myhaspl myhaspl 1915 September 18:05 bash_history
Drwxr-xr-x. 9 MYHASPL myhaspl 4096 June 14:38 hadoop-2.4.1
-rw-r--r--. 1 myhaspl myhaspl 15417097 June 14:42 hadoop-2.4.1-src.tar.gz
-rw-r--r--. 1 myhaspl myhaspl 138656756 June 14:42 hadoop-2.4.1.tar.gz
-rw-r--r--. 1 myhaspl myhaspl 1454 September 10:53 mydoclist
-rw-rw-r--. 1 MYHASPL MYHASPL 88 September 17:25 MyList
-rw-rw-r--. 3 MYHASPL myhaspl 357304 September 08:55 mypylist
-rw-rw-r--. 3 MYHASPL myhaspl 357304 September 08:55 mypylist1
-rw-rw-r--. 3 MYHASPL myhaspl 357304 September 08:55 mypylist2
-rw-rw-r--. 1 myhaspl myhaspl 31954 September 18:02 Myse
Drwxr-xr-x. 8 MYHASPL myhaspl 4096 September 10:39 numpy
DRWXR-----. 3 MYHASPL myhaspl 18 September 16:21. PKI
Drwxrwxr-x. Root root 4096 September 16:25 pypy-2.3.1-src
-rw-rw-r--. 1 myhaspl myhaspl 357304 September 17:57 SE
You can see that the number of hard links in Mypylist is increasing
Create soft links that can span different physical file systems, also known as Symbolic link files,
-bash-4.2$ ln-s mypylist mypylists
-bash-4.2$ Ls-la
Total dosage 151932
DRWX------. 6 MYHASPL myhaspl 4096 September 18 09:35.
Drwxr-xr-x. 3 root root 20 September 10 08:23..
-RW-------. 1 myhaspl myhaspl 1915 September 18:05 bash_history
Drwxr-xr-x. 9 MYHASPL myhaspl 4096 June 14:38 hadoop-2.4.1
-rw-r--r--. 1 myhaspl myhaspl 15417097 June 14:42 hadoop-2.4.1-src.tar.gz
-rw-r--r--. 1 myhaspl myhaspl 138656756 June 14:42 hadoop-2.4.1.tar.gz
-rw-r--r--. 1 myhaspl myhaspl 1454 September 10:53 mydoclist
-rw-rw-r--. 1 MYHASPL MYHASPL 88 September 17:25 MyList
-rw-rw-r--. 3 MYHASPL myhaspl 357304 September 08:55 mypylist
-rw-rw-r--. 3 MYHASPL myhaspl 357304 September 08:55 mypylist1
-rw-rw-r--. 3 MYHASPL myhaspl 357304 September 08:55 mypylist2
lrwxrwxrwx. 1 MYHASPL myhaspl 8 September 09:35 mypylists-mypylist
The road to mathematics-the basic technology of Distributed Computing-linux/unix (3)