commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
finds all forms instanciated into a symfony project, pruning svn files.
Get simple description on each file from /bin dir, in list form, usefull for newbies.
tar options may change ;)
c to compress into a tar file, z for gzip (j for bzip) man tar
-print0 and -0t are usefull for names with spaces, \, etc.
this will find text in the directory you specify and give you line where it appears.
For quick validation of folder's file-contents (structure not taken into account) - I use it mostly to check if two folders' contents are the same.
Very useful set of commands to know when your file system was created.
Great for finding which jar some pesky class is hiding in!
This command is useful when you want to know what process is responsible for a certain GUI application and what command you need to issue to launch it in terminal.
Find all files that contain string XXX in them, change the string from XXX to YYY, make a backup copy of the file and save a list of files changed in /tmp/fileschanged.
checking files in current and sub directories, finding out the files containing "sampleString" and removing the containing lines from the file.
* Beware that The command will update the original file [no backup].
The command can be extended if play with 'find' command together,
e.g. it is possible to execute on certain type of files: *.xml, *.txt... (find -name "*.xml" | grep....)
if anybody knows a better solution on that, please drop a comment. thx.
Counts number of lines of code in *.h and *.cc files
Create a tgz archive of all the files containing local changes relative to a subversion repository.
Add the '-q' option to only include files under version control:
svn st -q | cut -c 8- | sed 's/^/\"/;s/$/\"/' | xargs tar -czvf ../backup.tgz
Useful if you are not able to commit yet but want to create a quick backup of your work. Of course if you find yourself needing this it's probably a sign you should be using a branch, patches or distributed version control (git, mercurial, etc..)
This script first find all files which contains word xxxxx recursively. Then replace the word xxxxx to yyyyy of the files.
- Web site domain change
- Function name change of the program
Seq allows you to define printf like formating by specified with -f, %03g is actually tells seq I got three digits, fill the blank digits with 0, and the range is from 176 to 240.