Tag Info

Hot answers tagged

5

Deleting based on file mimetype To delete all non-jpeg regular files in the current directory or its subdirectories, use: find . -type f -exec bash -c 'file -bi "$1" | grep -q image/jpeg || rm "$1"' none {} \; This approach is safe for all file names. It will work even if the file names have newlines or other difficult characters in them. How it works ...


2

Use find: find . -name "*.xml" -exec cp -vt /newdir {} + This searches for all files ending with .xml. Then find executes cp -vt /newdir on them. With the + character find runs the cp command as few invocations as possible, stringing together as many arguments as the shell allows. Edit: if your cp hasn't the -t option, use this: find . -name "*.xml" ...


1

Your command find . -path '*/.svn' -prune -o -name "*.c" -print should indeed work, though you might rewrite it find . -name .svn -prune -o -name "*.c" -print otherwise your find is broken. I tried on 2 versions find --version: find (GNU findutils) 4.5.12 find (GNU findutils) 4.4.2


1

In Google chrome, you can start a search in the active tab by pressing Ctrl+F Or F3, input the text you want to find and press Enter to find You can loop through the search results by pressing the Enter. Once you found the text you want, if its a link or a button, you can navigate to it by pressing Ctrl+Enter Hope it helps.



Only top voted, non community-wiki answers of a minimum length are eligible