The road to mathematics-the basic technology of Distributed Computing-linux/unix (3)

Source: Internet
Author: User

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:
  1. File properties: Drwxr-xr-x
  2. 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 ".") )
  3. Owner: User
  4. Owning user group: group
  5. File size: 102 byte
  6. Modification Time: Mar11 22:56
  7. 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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.