When I use the -d, I only have the . that is displayed on the standard output. However, I also have other files in the current directory.
Asked
Active
Viewed 2,884 times
2 Answers
2
The -d option says:
-d, --directory
list directories themselves, not their contents
This is showing you . because that is your current directory. This could be used in combination with -l if you simply wanted to see the permissions/ownership of the directory, among other things.
jesse_b
- 37,005
0
The -d switch lists the directory itself and not the contents. In your case, that means the current directory. If you run ls -ld, it will show the permissions, ownership, last changed time, etc of the current directory.
If you run ls -d another_directory then it will show the same for whatever directory you specify.
Nasir Riley
- 11,422