Bash tricks, etc.

If you’re an avid bash user like me, you’re probably interested in ways you can speed-up and otherwise improve your CLI experience. I’ve compiled a list for your enjoyment. Perhaps time will turn this post into a more complete “Bash Tips & Tricks” list in the Magic section, but only maybe.

  • This thread on LQ (yes, I’m exit3219)
  • This page I’ve found today (make sure you read the comments, too)
  • man bash :D
  • CTRL+L to clear terminal (you don’t want to input clear and press Return, do you?)
  • Google search for “bash tricks” (this was the first thing you thought about, right?)
  • You can use basename to get rid of suffixes. How this may prove useful:

    for i in *.mp3; do
    mplayer “$i” -ao pcm:file=”$i”.wav &&
    oggenc -o “`basename “$i”.wav .mp3.wav`.ogg” “$i”.wav &&
    rm -fv “$i”.wav
    done

    This tiny script converts all mp3 files to ogg, and it changes the extension properly.

Note to self: I must update this. Things have changed a bit since then.

2 Responses to Bash tricks, etc.

  1. […] mai gasit un post interesant intr-un blog de al nostru, a lui exit3219 Bash tricks, etc. , nu uitati sa treceti prin sectiunea […]

%d bloggers like this: