When I run ls -lrt
command on a Unix folder , I get the following output
MyServer> ls -lrttotal 10drwxr-x--- 3 UnixUser other 512 Jul 22 2011 FolderAlrwxrwxrwx 1 UnixUser other 46 Aug 23 2011 BEA -> ../../../Some/Folder/SOLARIS/BEA
I am not sure what is BEA in these folders. They do not seem to be files nor folders. Why is there a arrow besides them pointing to somewhere else?
Best Answer
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:
- Permissions
- Number of hardlinks
- File owner
- File group
- File size
- Modification time
- 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 permissionw = write permissionx = execute permission- = no permission
Finally, the +
at the end means some extended permissions.
These are called symbolic links
in linux (shortcuts in windows)
When you work on them, for eg vim BEA
, you will be editing the actual file in ../../../Some/Folder/SOLARIS/BEA
The file in question is a symbolic link. The symbolic link is another name that "points to" the real file.
When you do ls -l
it also shows you which file is pointed to by the link. You can actually see:
lrwxrwxrwx^|________ `l` here means a link