Bash Shell: Display All Hidden Dot Files In a Directory
Q. How do I display only hidden (dot) file names under Linux / UNIX operating systems?
A. If you would like to see only hidden file in the current directory, use ls command.
Bash list only hidden files
Use ls -a command to display all hidden dot files. -a option do not hide entries starting with .
$ ls -a
Output:
gimp.txt .viminfo .gnome vivek-feed.xml .gnome2 .vlc .gnome2_private .vmware .gnome-desktop .wine .gnome_private Woh Lamhe - 2006-MP3-VBR-128Kbps go.html .Xauthority
As you see output includes all files including hidden dot files. To just display dot files use command:
$ ls -a | egrep '^\.'
$ ls -A | egrep '^\.'
You can create an alias and put into .bash_profile or .bashrc file
$ vi .bash_profile
Append following line
alias lh='ls -a | egrep "^\."'
Save and close the file. Now you can use lh command (read as alias) to display only hidden (dot) files:
$ lh
Capture each and every moment of life with a FREE 4 GB SD memory card with the purchase of select digital cameras from Canon, Nikon, Pentax and others from Amazon
E-mail
Print
Can't find an answer to your question? Contact us
Related Other Helpful FAQs:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: alias command, bash access hidden directory, bash display only hidden files, bash list only hidden files, bash ls display, display hidden files linux ls, egrep command, list only the dot files command, ls command



Recent Comments
Yesterday ~ 17 Comments
Yesterday ~ 5 Comments
Yesterday ~ 11 Comments
11/30/2008 03:50 pm (2 days ago) ~ 24 Comments
11/30/2008 11:51 am (2 days ago) ~ 6 Comments