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:
Use optimized sed to big file/stream to reduce execution time
sed '/foo/ s/foo/foobar/g' <filename>
insted of sed
Finds all tables that need optimising and loops through them, running optimise against them. This works server-wide, on all databases and tables.
-o : optimize
-p : asks for password
-u : user to use for authentication
For Mac OS X users only
Sqlite database keeps collecting cruft as time passes, which can be cleaned by the 'vacuum;' command. This command cleans up the cruft in all sqlite files relating to the user you have logged in as. This command has to be run when firefox is not running, or it will exit displaying the pid of the firefox running.