Commands by ScriptFanix (1)

  • Cleaner, but probably less portable. Works with bash4 and should also work on bash3. IIRC, $(()) and (()) are bashisms, not POSIX. Show Sample Output


    0
    while [$((or_sz=$(stat -c %s "$1"))) -gt $((ds_sz=$(stat -c %s "$2")))];do ((pct=(69*$ds_sz)/$or_sz));echo -en "\r[";for ((i=1;i<=pct;i++));do echo -n "=";done;echo -n \>;for ((i=pct;i<=68;i++));do echo -n ".";done;echo -n "] $(((100*$pct)/69))%";done
    ScriptFanix · 2011-07-29 17:41:56 4

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

Calculate pi to an arbitrary number of decimal places

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

kill some process (same as others) but parsing to a variable
Kills a process matching program. I suggest using $ pgrep -fl program to avoid over-killings Nice the following: kills all bash process owned by guest $ pkill -9 -f bash -u guest

Install a local RPM package from your desktop, then use the YUM repository to resolve its dependencies.
When downloading RPMs from the Internet, you don't have to 'rpm -i' or 'rpm -U' to install the package. Especially, if the package has dependencies. If you have YUM setup to access an RPM repository, this command will install the downloaded package, then any dependencies through YUM that it relies on. Very handy on RPM-based systems.

Find the package that installed a command

Spoof your wireless MAC address on OS X to 00:e2:e3:e4:e5:e6
If you want to check that the spoof worked, type the same command as earlier: $ifconfig en1 | grep ether Now you will see: $ether 00:e2:e3:e4:e5:e6 For the wired ethernet port: $sudo ifconfig en0 ether 00:e2:e3:e4:e5:e6

Download file with multiple simultaneous connections
jrk's aria2 example is incorrect. -s specifies the global connection limit; the per-host connection limit is specified with -x.

foo <--> german translation with dict.leo.org
Translate strings from non-german to german (and vice versa) using LEO. Put it in your ~/.bashrc. Usage: $ leo words   To use another language other than english, use an option: $ leo -xx words Valid language options: ch - chinese en - english es - spanish fr - french it - italian pl - polish pt - portuguese ru - russian The other language will always be german!

diff two svn repos ignoring spaces,tabs and svnfiles

GIT: list unpushed commits


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: