ls -d showing dot(.) as output why?
hi all
when i Giving command ls -d , it displaying dot only but according to concept it should be show the list f directory why? |
no
actually ls -d works exactly as expected. when you give no argument to ls it will take . (current directory) by default. -d means list directory itself instead of its content (see man page) |
According to manual
Code:
-d, --directory Code:
ls -ld If you want to see the list of sub-directories only (not the sub of sub-directories, only sub-directories), use this. Code:
ls -l | grep "^d" Code:
ls -l | grep "^d" | awk '{print $NF}' |
ls -d shows details of folder itself, not contents of folder.
For ex: Code:
$ ls -l /media Code:
$ ls -ld */ |
All times are GMT -5. The time now is 06:48 PM. |