Which command is suitable to list out all the directories in the working directory, in linux/unix environment?
Which command is suitable to list out all the directories in the working directory, in linux/unix environment?
Select an option to attempt
Correct Answer: Option C
Explanation
Linux command to list only directories:The correct Unix/Linux command pipeline:Step-by-step explanation:1.: long listing format; each line starts with a character indicating file type:-: directory-: regular file-: symbolic link-: block device2.: pipe output to grep;matches lines STARTING WITH 'd' (i.e., directories only).Why the other options are wrong:•:(one column) doesn't show file type prefix → won't work.•: wrong pipe direction (grep before ls makes no sense).•: this would only match files/dirs literally named 'dir...'Answer:correctly filters long-listing output to show only directories.