Searching in Nautilus can be sketchy and while
'locate ' works fine sometimes I need to be more specific when looking for a particular file to narrow down the search results.The 'find' command is quite powerful, but tricky to commit to memory when you don't use it often.
find (starting_directory) (test) (options) (match_criteria) (actions_to_perform_on_results)Find all "jpg" files starting at filesystem's root
find . -name "*.jpg"nb.
find / -name \*jpg does the same thing, escape the wildcard character * and saves typing quotes.Find directories (-type d):
find . -type dFind a specific directory
find . -type d -name \PicturesUse
-iname instead of -name to ignore case.Search multiple directories:
find /usr /etc /var/www -iname \index.htmlTo filter out permission errors add
2>/dev/null to the end of the line.Search for symbolic links
-type lThere are many more advanced switches which I'll add later if needed, this is just to explain basic searching.
No comments:
Post a Comment