LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   List files/directory names without directory contents? (http://www.linuxquestions.org/questions/linux-software-2/list-files-directory-names-without-directory-contents-878510/)

littlebigman 05-03-2011 04:32 AM

List files/directory names without directory contents?
 
Hello

When I run "ls -al somedir*" (I use the "ll" shortcut, actually), Linux not only list files that match, but also the contents of directories whose name also happens to match.

Is there a way to limit "ls" so that it will only show names (files and directories) and ignore the contents of the directories?

Thank you.

colucix 05-03-2011 04:36 AM

Yes. See man ls and look for the -d option.

littlebigman 05-03-2011 04:42 AM

Thanks for the tip. The alias is defined in the following files: /etc/skel/.bashrc, ~/.bashrc. Just change the "ll" alias, and run "source ~/.bashrc".


All times are GMT -5. The time now is 12:19 AM.