MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

UNIX

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following commands is used to display the directory attributes
A
cat
B
ls
C
mkdir
D
cp
Explanation: 

Detailed explanation-1: -Use the ls command to display the contents of a directory. The ls command writes to standard output the contents of each specified Directory or the name of each specified File, along with any other information you ask for with the flags.

Detailed explanation-2: -ls lists files and directories. If the pathname is a file, ls displays information about the file according to the requested options. If it is a directory, ls displays information about the files and subdirectories therein. You can get information about a directory itself using the-d option.

Detailed explanation-3: -The ‘ls’ command is “to list files.” ls command lists the files on the current working directory. You can see the hidden files, too, with the help of the-a attribute via the ls command. With the help of the ls command, you can also see lists of sub folders/directories of the current working directory.

Detailed explanation-4: -The ls command is used to list files. “ls” on its own lists all files in the current directory except for hidden files.

Detailed explanation-5: -You can list the attribute of the contents of a particular directory with lsattr command followed with a file or directory name as the argument. As the ls-l command, the-d option with lsattr will list the attributes of the directory itself instead of the files in that directory.

There is 1 question to complete.