List all files and directories in directory:
find <directory>List all files in directory:
find <directory> -type fList all directories in directory:
find <directory> -type dList all files matching pattern:
find <directory> -type f -name <pattern>Delete all matching files:
find <directory> -type f -name <pattern> -deleteExecute command on all matching files:
find <directory> -type f -name <pattern> -exec <command>Delete all swap files:
find . -type f -name "*.swp" -deleteAlternative approach using xargs:
find . -type f -name "*.swp" | xargs rmDelete all swap files with confirmation:
find . -type f -name "*.swp" -exec rm -i {} ";"