Commands by batandwa (6)


  • 3
    cat databases.txt | while read db; do docker exec $container_name bash -c "mysqldump -uroot -p\$MYSQL_ROOT_PASSWORD ${db}" | gzip -9 > $HOME/backups/${db}_`date +%Y%m%d_%H%M%S`.sql.gz; done
    batandwa · 2018-09-02 15:23:32 0
  • Creates a git repository in a predefined location. Show Sample Output


    -3
    git-createrepo() { repos_path='/srv/git/'; mkdir $repos_path$1; cd $repos_path$1; git init --bare; echo "Repository location: ssh://[email protected]`cat /etc/HOSTNAME``pwd`"; cd -; }
    batandwa · 2013-05-09 21:44:24 0
  • Watches for file modifications in the current directory and tails the file.


    -4
    watch 'ls -tr1 | tail -n1 | xargs tail'
    batandwa · 2013-05-09 11:37:59 0
  • Monitors the current directory for changes to HAML files and converts them to HTML. Show Sample Output


    0
    while true; do filechanged=$(inotifywait -e close_write,moved_to --format "%w%f" .); haml $filechanged -q --no-escape-attrs > ${filechanged/.haml/.html}; done
    batandwa · 2013-05-01 21:15:26 1

  • 0
    git diff --name-only --diff-filter=AMXTCR HEAD~2 HEAD | xargs -l -I{} cp --parents --verbose "{}" target_dir
    batandwa · 2013-02-11 08:12:40 0

  • 0
    ngrep host 192.168.1.6 -O $(date +%Y%m%d_%H%M%S).pcap > $(date +%Y%m%d_%H%M%S).txt
    batandwa · 2012-10-03 13:09:19 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



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: