using grep command
HI
can anyone plz tell me how do i displayout the list of directories from my current working directory using grep command. :o |
Welcome to LQ---Looking at both of your posts, it looks like you are asking homework questions. You need to be aware of the policies on this.
One way to do this is use the "ls -l" command and then use grep to find the leading "d" on all the directories. Look at: man ls man grep |
If your just looking to list the directories use ls to see all directories even hidden ls -a.
To learn more about grep man grep Use grep with pipe ls | grep argument |
You can also try
Code:
ls -d */ |
To list all directories including the hidden ones:
ls -al | grep "^d" |
All times are GMT -5. The time now is 04:04 AM. |