Sometimes I forget the name of a particular config file but know it's stored as a dot file in my home directory. The following one-liner will non-recursively display any regular file begining with a dot.
find . -maxdepth 1 -type f -name '.*'
Find does it again. ;-)
Tuesday, December 2, 2008
Subscribe to:
Post Comments (Atom)
5 comments:
ls -d .*
@Kurt
That's good for dirs, but I was looking for files in this case.
For quickness, I type:
.*<tab><tab>
...that expands directories as well, but beats the other methods on speed. In general, <tab><tab> is a great way to see what your wildcards will expand to.
ls -d .*
Lists plain files and directories. The -d is "list directory entries instead of contents". If you really do want to see only the files, then sure, you need the find command. It's a lot of typing to avoid seeing the directory names, though.
Post a Comment