deeejay

Bash - Find files and directories

Feb 19th, 2016 (edited)
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.54 KB | None | 0 0
  1. Find a file named postgresql.conf
  2. find / -name postgresql.conf
  3.  
  4. Find a file named postgresql.conf (case-insensitive)
  5. find / -iname postgresql.conf
  6.  
  7. Find a file named postgresql.conf
  8. find / -type f -name postgresql.conf
  9.  
  10. Find a file based on wildcard and cp to a specified folder
  11. find . -name "*20150727*" -exec cp {} ../verify \;
  12.  
  13. Find a file based on the extension
  14. find . -name '*.swp' -print0
  15.  
  16. Find and delete all swap files
  17. find . -type f -name ".*.swp" -exec rm -f {} \;
  18.  
  19. Locate a file named recovery.sh
  20. updatedb
  21. locate recovery.sh
Advertisement
Add Comment
Please, Sign In to add comment