What does the permission string lrwxrwxrwx mean?
The leading l
indicates that this file is a symlink, in contrast to -
which indicates a regular file, d
which indicates a directory, and other less common prefixes.
A symlink is type of file which only contains a link to another file. Reading a symlink reads the real file. Writing to a symlink writes to the real file. cd
ing to a symlink that is to a directory results in behaviour almost identical to what would happen if you had cd
'd into the real directory.
The permission bits are displayed as rwxrwxrwx
. All symlinks show these bits, but they are "dummy permissions". The actual (or effective) permissions of a symlink are the permissions of the real file it links to. You can get the real permissions (and file type) by running stat
on the symlink, for example:
$ stat -Lc '%a %A' /initrd.img
644 -rw-r--r--
-
stat
read file metadata -
-L
dereference (follow) symlinks -
-c
select output according to specified string -
%a
octal permissions -
%A
"human readable" permissions
The ls -sl command
The Linux command ls
= List of files in the directory you are in
The added switch -sl
= print short list
The resulting this example part of the output: lrwxrwxrwx
In my shortest explanation would be:
The first letter will usually be either: l
, d
, or -
:
l
= Link to another file
d
= a directory
-
= file
r
= read permission - Read the file
w
= write permission - Write or edit the file
x
= execute permission He can execute the file
-
= no permission
Number Permission Type `Symbol`
0 No Permission `---`
1 Execute `--x`
2 Write `-w-`
3 Execute + Write `-wx`
4 Read `r--`
5 Read + Execute `r-x`
6 Read + Write `rw-`
7 Read + Write + Execute `rwx`
In Summary: The file type and access and Permissions the Ownership, and User; privileges such as Read and/or Write for each directory or file that is listed in the output.
a l
for a link , d
for a directory or -
for a file and these are set by the Linux operating system. You can not manually change these letters (unless you change the file type of course).
(ie... lrwxrwxrwx 1 root root 1024 Feb 13 09:45 myfile3
)
Please refer to: http://earthen.tripod.com/linuxper.htmPermissions (Setting up the modes)
~ Samuel F Campbell