Find files

From Bytesized Wiki

Jump to: navigation, search

Find files

  • To find specific files by name in your home folder, use this command:
find ~ -name [name_of_file]

~ stands for your home folder; same as $HOME or /home/hd/username

  • For example:
find ~ -name bluray

will find all files with the word bluray in the name. You can use wildcards like * to search a partial name, like blu*

  • To find files by extension, use this command:
find ~ -name "*.[given_extension]"
  • For example:
find ~ -name "*.jpg"

will show you all files, with the .jpg extension.

Remove a folder

  • To remove a whole folder, with files still in it, execute this command:
rm -rf foldername/

-r is for recursive -f is for force removal If the folder name has a space in it, use quotes around the folder name:

rm -rf "some folder name"
Personal tools