Commands by roberto_scotti (1)

  • find '.odt' files that contain USAGE: grepodt


    0
    grepodt () { W=$1;P=$2;ls *.odt > /dev/null 2>&1;if [[ $? -ne 0 ]];then exit 1;fi;if [[ ! "$P" ]];then P='*';fi;for i in $P.odt;do unzip -qq "$i" content.xml;grep -l $W content.xml>/dev/null;if [[ $? -eq 0 ]];then echo $i;fi;rm content.xml; done;}
    roberto_scotti · 2015-12-09 20:37:52 0

What's this?

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.

Share Your Commands


Check These Out

Prepend a text to a file.
Using the sed -i (inline), you can replace the beginning of the first line of a file without redirecting the output to a temporary location.

list files recursively by size

Suppress output of loud commands you don't want to hear from
Suppresses all output to /dev/null. This could be expanded to check for a -l command line option to log the stderr to a file maybe -l file or -l to log to default quietly.log. I'm finding that I use it more often than one would think.

Scroll up (or Down (PgDn)) in any terminal session (except KDE)

Run command from another user and return to current

Sed can refference parts of the pattern in the replacement:

Show total disk space on all partitions
show off how big your disks are

Check syntax of remote ruby file

Decrypt passwords from Google Chrome and Chromium.
Read this before you down voting and comment that it is not working -> Wont work on latest versions ~75> since database file is locked and has to be decrypted. This is useful if you have an old hdd with a chrome installation and want to decrypt your old passwords fast.

Find all dot files and directories


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: