2014-02-28 77 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/ –