Commands tagged save (4)

  • Faster then other method using wget For obtain all commands use nu=`curl |grep -o "Terminal - All commands -.*results$" | grep -oE "[[:digit:],]{4,}" | sed 's/,//'`; curl[0-"$nu":25] | grep -vE "_curl_|\.com by David" > clf-ALL.txt For more version specific nu=`curl |grep -o "Terminal - All commands -.*results$" | grep -oE "[[:digit:],]{4,}" | sed 's/,//'`; curl[0-"$nu":25] | grep -vE "_curl_|\.com by David" > clf-ALL_"$nu".txt Also download dirctly from my dropbox My drop box invitaion link is . Use it and get free 2.5 GB space. Show Sample Output

    curl[0-9000:25] | grep -vE "_curl_|\.com by David" > clf-ALL.txt
    totti · 2011-11-08 12:19:48 1
  • The simpler, 1-arg version is save_function(){ { date +"# %F.%T $1; declare -f "$1";}| tee -a ~/.bash_functions; }` Show Sample Output

    save_function(){ while [[ $# > 0 ]]; do { date +"# %F.%T $1; declare -f "$1";}| tee -a ~/.bash_functions; shift; done;}
    mcint · 2019-07-17 01:06:59 0

  • 0
    :w !sudo tee %
    KodjoSuprem · 2013-09-25 08:56:21 0
  • Yeah, there are many ways to do that. Doing with sed by using a for loop is my favourite, because these are two basic things in all *nix environments. Sed by default does not allow to save the output in the same files so we'll use mv to do that in batch along with the sed. Show Sample Output

    for files in $(ls -A directory_name); do sed 's/search/replaced/g' $files > $ && mv $ $files; done;
    bassu · 2009-05-07 20:13:07 12

What's this? 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

ping a host until it responds, then play a sound, then exit
This allows for sleeping in between pings. Also, espeak needs to be installed.

Install pip with Proxy
Installs pip packages defining a proxy

Execute a sudo command remotely, without displaying the password
The ssh command alone will execute the sudo command remotely, but the password will be visible in the terminal as you type it. The two stty commands disable the terminal from echoing the password back to you, which makes the remote sudo act as it does locally.

password generator
make password randomly, default 8 chars, using bash3.X only, no external program.

Get information about libraries currently installed on a system.
This command is very helpful when we need to duplicate a test scenario and first we want to find out the installed libraries together with the version and release numbers and architecture. (look example) Command can be tuned by choosing just the names of libraries we are interested in. For example glibc and gcc.

Get AWS temporary credentials ready to export based on a MFA virtual appliance
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token. This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use: `awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'` You must adapt the command line to include: * $MFA_IDis ARN of the virtual MFA or serial number of the physical one * TTL for the credentials

revert a committed change in SVN
This command can be used to revert a particular changeset in the local copy. I find this useful because I frequently import files into the wrong directory. After the import it says "Committed revision 123" or similar. to revert this change in the working copy do: svn merge -c -123 . (don't forget the .) and then commit.

Rotate all jpeg images in current folder, rename them to EXIF datetime and set files timestamp to EXIF datetime

most changed files in domains by rdiff-backup output

Create a single PDF from multiple images with ImageMagick
Given some images (jpg or other supported formats) in input, you obtain a single PDF file with an image for every page.

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.


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: