answersLogoWhite

0

The command

ls /

will list the contents of the root directory; most items will be directories or links. If you want to see only directories,

ls -l / | grep ^d

will give a "long" list (including information other than the directory name) but limited to those lines beginning with a "d", indicating a directory.

The output of this pipeline can be piped to the awk utility to select only the last word of each line, which will be the directory name; alternatively the output can be redirected to a text file which you can then edit:

ls -l / ] grep ^d > textfilename

Another approach would be to use the find command to search / for entries of type d, with search depth limited to 1.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is the purpose of rd command in command line interface?

The rd command, short for "remove directory," is used in command line interfaces to delete empty directories. It is commonly used in Windows Command Prompt and can be executed with options to remove multiple directories or to force the deletion of directories that contain files, depending on the specific syntax used. If a directory is not empty, the command will fail unless additional parameters, like /S, are specified to remove all contents.


What is the Linux command used to list the contents of a directory?

ls will list the contents of a directory.


Which MS-DOS command is used to delete a directory and its sub directories in one pass?

To delete directory and sub directory in single command, use "deltree" command..


How do you use cmd?

CMD or the command line is used to execute instructions & programs. Many commands such as (dir) can be executed like this c:\>dir This will list the current directories content. :)


What is the significance of the keyword 'mv' in the context of the Linux command 'mv r'?

In the context of the Linux command 'mv r', the keyword 'mv' stands for 'move', indicating that the command is used to move or rename files or directories.


Unlock files in directory using dos commands?

Dos commands are used to create or delete directories. The ATTRIB Command is used for locking and unlocking of files.


What command is used to see a list of all services currently installed?

chkconfig --list


Which command is used to move a file?

The command MV is used to move a file in simple Linux Code. This command will move files and directories from one spot to another spot. To move a file, one would simply type in the letters MV before its name.


How would you list the mount points on the remote system named bravo that the local system named grape can mount?

To list the mount points on the remote system named bravo that the local system named grape can mount, you can use the showmount command. On the local system grape, run showmount -e bravo to see the exported directories that grape can mount from bravo.


Is path command an ms dos internal command?

Yes, the PATH command is an internal command in MS-DOS. It is used to specify the directories in which the operating system looks for executable files when a command is entered. By modifying the PATH variable, users can streamline command execution and avoid typing the full path to a program.


What does the command RD do?

The command RD (or rmdir) is used in command-line interfaces like Windows Command Prompt to remove directories. It deletes an empty directory, and if the directory contains files or subdirectories, it will return an error unless the /S flag is used, which allows for the removal of the directory and all its contents. Always use caution with this command, as it can lead to data loss if used incorrectly.


What is remove command?

The remove command is typically used in various programming and command-line environments to delete files, directories, or specific data. In Unix-like systems, the command is often represented as rm, which allows users to remove files and directories with options for recursive deletion and forced removal. In programming languages, similar functions exist to remove elements from data structures or files. The exact syntax and behavior can vary based on the specific environment or language being used.