Computer Science - Unix - Discussion
Discussion Forum : Unix - Section 1 (Q.No. 43)
43.
Which column contains all details of the permissions of a file when you issue the ls -l command?
Answer: Option
Explanation:
root@server [~]# ls -l .... -rw------- 1 root root 37 Dec 31 2009 .my.cnf -rw------- 1 root root 737 Aug 18 21:20 .mysql_history -rw-r--r-- 1 root root 264 Aug 18 16:51 .pearrc ....
Discussion:
7 comments Page 1 of 1.
Manish said:
7 years ago
Why not A?
Aastha said:
9 years ago
Exactly. Correct answer is second column i.e. A option.
Firoz said:
10 years ago
Every file or directory has a set of access permissions, sometimes called the file mode, which determines who can read or modify it.
To see the permissions on a file, use the command " ls -lg file ", or just cd to the directory containing the file and type " ls -lg " to get the permissions of all the files in the directory. To see the permissions of a directory, type " ls -lgd directory ". The d option tells ls you're interested in the directory itself, rather than the files within it. " ls -lgd. " shows you the current directory.
The output from " ls -lg " for a file will look something like this:
-rwxr-x---1 russellj ugrad 15065 Apr 19 15:37 file name.
The name of the file is in the last column. The third column, "russellj", is the userid of the owner of the file (generally the person who created it).
The fourth column, "ugrad", is the "group" of the file.
The first column, "-rwxr-x-", shows the file's permissions. They are divided into four parts. The initial "-" just means this is an ordinary file.
To see the permissions on a file, use the command " ls -lg file ", or just cd to the directory containing the file and type " ls -lg " to get the permissions of all the files in the directory. To see the permissions of a directory, type " ls -lgd directory ". The d option tells ls you're interested in the directory itself, rather than the files within it. " ls -lgd. " shows you the current directory.
The output from " ls -lg " for a file will look something like this:
-rwxr-x---1 russellj ugrad 15065 Apr 19 15:37 file name.
The name of the file is in the last column. The third column, "russellj", is the userid of the owner of the file (generally the person who created it).
The fourth column, "ugrad", is the "group" of the file.
The first column, "-rwxr-x-", shows the file's permissions. They are divided into four parts. The initial "-" just means this is an ordinary file.
Semaphore said:
1 decade ago
Yes the correct answer is Second.
$ ls -l.
Drwxr-xr-x 4 cliff user 1024 Jun 18 09:40 WAITRON_EARNINGS.
-rw-r--r-- 1 cliff user 767392 Jun 6 14:28 scanlib.tar.gz.
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^.
| | | | | | | | | | |.
| | | | | owner group size date time name.
| | | | number of links to file or directory contents.
| | | permissions for world.
| | permissions for members of group.
| permissions for owner of file: r = read, w = write, x = execute - = no permission.
Type of file:- = normal file, d = directory, l = symbolic link, and others.
$ ls -l.
Drwxr-xr-x 4 cliff user 1024 Jun 18 09:40 WAITRON_EARNINGS.
-rw-r--r-- 1 cliff user 767392 Jun 6 14:28 scanlib.tar.gz.
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^.
| | | | | | | | | | |.
| | | | | owner group size date time name.
| | | | number of links to file or directory contents.
| | | permissions for world.
| | permissions for members of group.
| permissions for owner of file: r = read, w = write, x = execute - = no permission.
Type of file:- = normal file, d = directory, l = symbolic link, and others.
Shreekant said:
1 decade ago
The correct answer is second column.
Priyesh said:
1 decade ago
Yes, first column specifies whether it is a directory or file or something else along with permissions.
Buttkumro said:
1 decade ago
This is incorrect as the first column specifies what sort of file an entry is. The correct option is A.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers