commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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:
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.
There are 4 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.
The first part isn't strictly necessary, right? Since sqlite will fail gracefully if firefox is already running? I think you could use find to do everything, with an admittedly odd-looking -exec argument:
find ~/.mozilla/firefox -name "*.sqlite" -exec bash -c "<<<'vacuum;' sqlite {}" \;using "here documents" to substitute a string for stdin. Putting echo before bash helps to see what commands would be run without running them :-).
Yeah. I guess so. I was ujst being extra carefull with the pid part.
With the "do everything with find, I do completely agree with you. And it is better too, because it will correctly handle if there is a newline in the file name. Whereas my code will fail miserably.
But I would like to point out that you need to be carefull with your quotes.
find ~/.mozilla/firefox -name '*.sqlite' -exec bash -c "
Wow, all this seemed to do it delete my profile. -1
@nvb4 delete your profile?? wierd. That should never happen unless your sqlite files were corrupted in the first place. Did you use a wrong version of sqlite?