you can use svn_find just like the regular find command, except that subdirectories named .svn will be ignored. example: svn_find . -mtime -1 -size +200k -ls -> all files modified within last day and bigger then 200 KiB, but ignores subdirectories named .svn
Removes all files in the current folder that are 1400 bytes in size.
If you make a mess (like I did) and you removed all the executable permissions of a directory (or you set executable permissions to everything) this can help.
It supports spaces and other special characters in the file paths, but it will work only in bash, GNU find and GNU egrep.
You can complement it with these two commands:
1. add executable permission to directories:
find . type d -print0 | xargs -0 chmod +x
2. and remove to files:
find . type d -print0 | xargs -0 chmod -x
Or, in the same loop:
while IFS= read -r -u3 -d $'\0' file; do
case $(file "$file" | cut -f 2- -d :) in
:*executable*|*ELF*|*directory*)
chmod +x "$file"
;;
*)
chmod -x "$file"
;;
esac || break
done 3< <(find . -print0)
Ideas stolen from Greg's wiki: http://mywiki.wooledge.org/BashFAQ/020
Change "sort -f" to "sort" and "uniq -ic" to "uniq -c" to make it case sensitive. Show Sample Output
Find all files in /var/spool/mqueue older than 7 days, pass to perl to efficiently delete them (faster than xargs or -exec when you've got millions or hundreds of thousands to delete). Naturally the type, directory, and file age vars can be adjusted to meet your specific needs.
-sl : show just file names
This command will : -Archive all *.dmp files individually (one file per archive) from current directory . -Delete original file after has been compressed.
Find which directories on your system contain a lot of files. Edit: much shorter and betterer with -n switch. Show Sample Output
Requires ImageMagick to be installed. This command was stolen from @climagic on Twitter. Probably a duplicate of command below, but this command uses slightly higher quality. http://www.commandlinefu.com/commands/view/707/compress-images-using-convert-imagemagick-in-a-bulk
When a large maven release goes wrong, by deploying just some of the artifacts letting others behind, some projects got wrong SNAPSHOT versions. This command comes to help! Tip: replace sed's regex by your version numbers
Enhancement for the 'busy' command originally posted by busybee : less chars, no escape issue, and most important it exclude small files ( opening a 5 lines file isn't that persuasive I think ;) ) This makes an alias for a command named 'busy'. The 'busy' command opens a random file in /usr/include to a random line with vim.
Let's say you have a set of files in tree A that you want duplicated to tree B while preserving their directory structure / hierarchy. (For example, you might want to copy your 'profile' model/views/controller from one Rails application to another.) The "pax" command will copy all matching files to the destination while creating any necessary directories.
This sums up the page count of multiple pdf files without the useless use of grep and sed which other commandlinefus use. Show Sample Output
Fixes MP3 tags encoding (to UTF-8). Batch fixes all MP3s in one directory.
Modify all files newer than another file and touch them to a specific date. Show Sample Output
Archive all .sh files in a directory into a gzip archive.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: