了解 ls 输出

mis*_*ded -1 unix

当我ls -lrt在 Unix 文件夹上运行命令时,我得到以下输出

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
Run Code Online (Sandbox Code Playgroud)

我不确定这些文件夹中的 BEA 是什么。它们似乎不是文件或文件夹。为什么除了它们之外还有一个箭头指向其他地方?

Pav*_*pta 7

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.
Run Code Online (Sandbox Code Playgroud)