This will cause diff to ignore any files whose path matches "*CVS*", ie any CVS control files.
on a dpkg managed system this PATTERN will help you generate .deb files from source AND remove all the dev libs you had to install. i hate cluttering up my machine with rouge packages and headers. it would be pretty darn easy on rpm systems as well. i just dont have a rpm managed system to test on right now. NOTE, you sharp ones will notice that it uninstalls the deb you just made! yeah, but the deb is still there to do with it what you want, like re install it. or you can just grep -v after the diff
Use zsh process substitution syntax.
The result of this command is a tar with all files that have been modified/added since revision 1792 until HEAD. This command is super useful for incremental releases.
LC_ALL=C is here to always grep on "differ" whatever your language env. xargs -n 2 to run gvim -d with 2 arguments gvim --nofork to use only one instance of gvim
Maybe very limited in its applicability but could be of use at times. Show Sample Output
Removes an extra character and space.
This will extract the differing CSS entries of two files. I've left the initial character (plus or space) in output to show the real differing line, remove the initial character to get a working CSS file. The output CSS file is usable by either adding it in a below the to original.css, or by only using the output but adding @import url("original.css"); in the beginning. This is very useful for converting Wordpress theme copies into real Wordpress child themes. Could exclude common lines within entries too, I guess, but that might not be worth the complexity. Show Sample Output
If you have ever edited a locally checked out version of a file to tweak it for testing purposes, and came back to it over a weekend, you might have forgotten what you exactly changed. This command helps you see the differences between the the checked in SVN version, and the one you tweaked. Show Sample Output
The normal output of 'diff' is a wonderful thing. But just sometimes, you want something that is a little more... well... readable. This is that command. -d - (optional) find the minimal set of changes -b - (optional) ignore changes in the amount of whitespace -B - (optional) ignore changes that just insert or delete blank lines -y - this is where the magic happens! Use the side-by-side output format. -w $COLUMNS - more magic! Instead of using 80 columns, use the current width of the terminal.
I use this a lot to sync changes between folders that don't share a SVN or GIT repository. If you want to preview the command before executing, just leave out the last part ("| sh")
this alternative shows the differences as they occur so that they are made plain Show Sample Output
The command will make it easy to determine free IP ranges in a crowded sub-net. Show Sample Output
Good for when your working on building a clean source install for RPM packaging or what have you. After testing, run this command to compare the original extracted source to your working source directory and it will remove the differences that are created when running './configure' and 'make'.
Get the list of changed files between revision 43 and HEAD revision: svn diff . -r43:HEAD --summarize Strip extra 8 characters from every line: cut -c9-99999 Copy the listed files to home/me/destination: cpio -pvdmu ~/destination Make a plain copy (-p), list files being copied (-v), create needed directories (-d), preserve modification time (-m), overwrite unconditionally (-u) Show Sample Output
Runs a diff on two files ignore comments and blank lines (diff -I=RE does not work as expected). Adapted from a post found on stackexchange.
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: