Re: [Linuxcommand-discuss] finding hidden files
Brought to you by:
bshotts
|
From: William S. <wes...@co...> - 2002-09-08 18:06:34
|
On Sunday 08 September 2002 01:27 pm, Steve Sanders wrote: > Greetings all! I am new to the list so I apologize if this question is out > of place because it is too basic. I am taking a class at college on Linux. > We are completing a lab, and one of the questions was to determine how > many hidden files there are in the /etc directory. I found the answer > using: ls -a > I am just wondering if there is a way to just display the hidden files. I > tried using: ls -a | grep .* > but it seemed to ignore the . and just display everything. I tried several > other things as well, but everything seemed to just ignore the ".". So, > does anyone know a way to just display the hidden files in the /etc > directory? Thanks for the help. > > Steve If you want to know the number of hidden files in /etc and all of its subdirectories, try: find /etc -type f -name ".*" | wc -l If you just want the number of hidden files in /etc (not its subdirectories), try: find /etc -type f -name ".*" -maxdepth 1 | wc -l To use ls to get an approximate list of the hidden files (plus the . and .. entries), try: ls -d .* -- ||||| William Shotts, Jr. (bshotts AT panix DOT com) ||||| Be a Linux Commander! Follow me to http://linuxcommand.org |