views:

155

answers:

4

Hello,

I'm looking for a Linux command to go through all the directories on my server and find all .htaccess files. The output would be a list of all those files with full path, creation/modification date and filesize.

A: 

find -name .htaccess

Dmitry
+9  A: 

find / -name ".htaccess" -print

Replace / with the root folder you like to start searching, in case you don't want to search the whole file system.

Wikipedia has an article about find, which also links to its man page.

bluebrother
Note that, if you start from the root directory / , you'll need to run the find command with root privileges so that you're able to read all subdirectories on the system.
gareth_bowles
+2  A: 

It's easy with the find command.

find / -name .htaccess -exec ls -l {} \;

This will print the name, and the file details according to ls -l. Note that this is starting the search under /, which may take a long time. You might want to specify a different folder to search.

jheddings
A: 

Could be as simple as

ls -l $(locate .htaccess)

if updatedb has run recently.

ewg