2014-02-28 76 views
0

當我在Unix文件夾運行ls -lrt命令,我得到下面的輸出瞭解LS輸出

MyServer> ls -lrt 
total 10 
drwxr-x--- 3 UnixUser other  512 Jul 22 2011 FolderA 
lrwxrwxrwx 1 UnixUser other   46 Aug 23 2011 BEA -> ../../../Some/Folder/SOLARIS/BEA 

我不知道什麼是BEA在這些文件夾。他們似乎不是文件或文件夾。爲什麼除了指向別的地方之外還有箭?

回答

0

實際的文件有問題的文件是一個象徵鏈接。符號鏈接是「指向」真實文件的另一個名稱。

當你做ls -l它也顯示你的鏈接指向哪個文件。實際上,你可以看到:

lrwxrwxrwx 
^ 
|________ `l` here means a link 
1

這些被稱爲在linux symbolic links(在Windows快捷方式)

當你對他們的工作,對於如vim BEA,你會被編輯在../../../Some/Folder/SOLARIS/BEA

+0

「捷徑」在Windows中沒有任何共同之處與UNIX(符號鏈接或硬)鏈接。 UNIX符號鏈接與[Windows/NTFS鏈接](http://en.wikipedia.org/wiki/NTFS_symbolic_link)相當。 –

+0

好吧,我在這裏理解的是windows的快捷鍵是linux符號鏈接的超集。 [Wiki](http://en.wikipedia.org/wiki/Symbolic_link) – brokenfoot

2
BEA and Perlx.x in these folders are symbolic links. The symbolic link is another name that "points to" the real file. 

The option '-l' tells the command to use a long list format. It gives back several columns wich correspond to: 

1. Permissions 
2. Number of hardlinks 
3. File owner 
4. File group 
5. File size 
6. Modification time 
7. Filename 

The first letter in the permissions(**lrwxrwxrwx**) column show the file's type. **`l` here means a link**, A 'd' means a directory and a '-' means a normal file (there are other characters, but those are the basic ones). The next nine characters are divided into 3 groups, each one a permission. Each letter in a group correspond to the read, write and execute permission, and each group correspond to the owner of the file, the group of the file and then for everyone else. 

[ File type ][ Owner permissions ][ Group permissions ][ Everyone permissions ] 
The characters can be one of four options: 

r = read permission 
w = write permission 
x = execute permission 
- = no permission 
Finally, the "+" at the end means some extended permissions. 
+0

瞭解更多詳情:http://www.thegeekstuff.com/2009/07/linux-ls-command-examples/ –