How one can list only the name of directories present in the directory by using ls co


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How one can list only the name of directories present in the directory by using ls co
# 1  
Old 01-30-2004
How one can list only the name of directories present in the directory by using ls co

How one can list only the name of directories present in the directory by using ls command.
# 2  
Old 01-30-2004
use the -l switch and then use some sort of text filter on stdout for a common referance for directories in each string.

Last edited by Optimus_P; 01-30-2004 at 01:23 PM..
# 3  
Old 02-01-2004
I posted the solution, but in light of this maybe being homework, read the man page for "ls" ... the answer's there.

http://unixhelp.ed.ac.uk/CGI/man-cgi?ls
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

List all files and directories in the current directory separated by commas and sorted by crtime

What I know so far: ls -A will list all files except those starting with a dot ls -d will list all directories ls -m will separate contents by commas For getting crtimes use: stat filename will give me the inode number or ls -i filename will give... (13 Replies)
Discussion started by: chstewar
13 Replies

2. Shell Programming and Scripting

Finding non-existing words in a list of files in a directory and its sub-directories

Hi All, I have a list of words (these are actually a list of database table names separated by comma). Now, I want to find only the non-existing list of words in the *.java files of current directory and/or its sub-directories. Sample list of words:... (8 Replies)
Discussion started by: Bhanu Dhulipudi
8 Replies

3. Shell Programming and Scripting

Joining files present in different directories.

Hi Experts, I have files Bank1 ,Bank2 ,Bank3 with high level customer information in one folder. /home/Cust_information/ Bank1,Bank2,Bank3,Bank4 The detail level information of all customers of each Bank are present in separate directories . Here Bank1 is a directory which contains set... (2 Replies)
Discussion started by: bharathbangalor
2 Replies

4. Shell Programming and Scripting

List file NOT present in other directory

Dear community, I have one LOG directory with some files. What I need to do is list ONLY the files that are not present in other directory. Using Bash programming! LOG DIR | SYNC DIR FILE1 | FILE1 FILE2 | FILE3 FILE3 | OTHER FILENAME FILE4 ... (9 Replies)
Discussion started by: Lord Spectre
9 Replies

5. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

6. Solaris

how to find the list of all packages present in a directory

Hi I'm in a directory named /tmp/mq7 i need to upgrade the mq version from 6 to 7 but im not sure where is the package located ? which command in solaris will show me the list of all the packages present in the directory /tmp/mq7 ? my box is running with solaris version 10. (2 Replies)
Discussion started by: newtoaixos
2 Replies

7. Solaris

How list all directories in a directory?

Hi How can i list all the directories inside a directory? not only the directories in the present dir. also the directories inside directories present in the dirrectory. recursive. "find . -type d" will work with other Unix flavors but not with SunOS. Please help Robin (1 Reply)
Discussion started by: robinbannis
1 Replies

8. UNIX for Dummies Questions & Answers

List files that are not directories from current directory

I can't manage to list all files that are not directories from current directory. (2 Replies)
Discussion started by: beni22sof
2 Replies

9. Shell Programming and Scripting

ls > file - Creating file containing the list of all files present in a directory

Hi All, I need to create a file which contains the list of all the files present in that directory. e.g., ls /export/home/user/*.dat > list_file.dat but what i am getting is: $ ls /export/home/user/*.dat > list_file.dat /export/home/user/*.dat: No such file or directory But I have... (1 Reply)
Discussion started by: pranavagarwal
1 Replies

10. UNIX for Dummies Questions & Answers

list file's by size order in sepecfied directory and sub directories

How do I list files of type "*.file" for example by size order recursively ? (2 Replies)
Discussion started by: ferretman
2 Replies
Login or Register to Ask a Question