Watch file's contents that is getting overwritten Show Sample Output
Actually this is a shorter version that fits the 255 chars limit of this resource. The full version shows status in the right top corner:
alias mpdd='while sleep 1; do _r=$(awk '\''BEGIN{FS=": "}/^Artist:/{r=r""$2};/^Title:/{r=r" - "$2};/^time:/{r=$2" "r};/^state: play/{f=1}END{if(f==1){print r}}'\'' <(mpc status;mpc currentsong));_l=${#_r};[ $_l -eq 0 ] && continue;[ -z "$_p" ] && _p=$_l;echo -ne "\e[s\e[0;${_p}H\e[K\e[u";_p=$((COLUMNS - _l));echo -ne "\e[s\e[0;${_p}H\e[K\e[0;44m\e[1;33m${_r}\e[0m\e[u";done &'
mpc is defined like this:
function mpc() {
echo "$*" | nc 192.168.1.1 6600
}
Show Sample Output
Ssh to your co-worker's box and watch them go crazy when the cd player ejects Show Sample Output
This command is good for a cron job or where you may have a lot of jobs potentially coincide on a scarce resource (like writing files back to a file server all at once). This will insert a sleep of a random amount of time up to an hour.
Used in OS X. tr "\n" ";" may be replaced by echo ";" with linux versions of date. I reused ping -q -c 1 www.google.com|tail -1|cut -d/ -f5 Show Sample Output
This will cause their computer to make a beeping sound after a random amount of time until it is killed.
This has saved me many times while debugging timeout issues to "too many open files" issues. A high number of the order of thousand, indicates that somewhere connection is not being closed properly. Show Sample Output
This one works without an external program (watch). Witch is not await able all the time. HINT: use CTRL + C to exit the loop.
This one is for OS X users: sort -R and shuf aren't available in Lion (10.7.5)
Run one script after another in such a way that second script starts after finishing first one. Without using Pipe | or ampercent && i.e. the first process is already running and you want second one to start after the first one finishes. And this can be done in different folder in case the output of second script will affect the output of first script. So run this on any folder you wish to. Where $PID is the process id of the already running job (add PID number) script2 is your script you wish to run after first script ends sleep 1 is sleep for one second (SUFFIX may be ?s? for seconds (the default), ?m? for minutes, ?h? for hours or ?d? for days, read man sleep) Show Sample Output
Typing a word in terminal is easier than digging your phone out, opening your two-factor authentication app and typing the code in manually. This alias copies the one-time code to your clipboard for 3 seconds (long enough to paste it into a web form), then restores whatever was on the clipboard beforehand. This command works on Mac. Replace pbpaste/pbcopy with your distribution's versions.
Chronometer using the bc calculator. Show Sample Output
Everytime You Run Bash It Will Run And Send The Command To Background In A Loop Forever. This Is Useful In Android To Avoid Getting Discconnected While Using ADB Or Other Services Like SSH By Being Inactive For Long Periods Of Time. In My Case I Get Bash Full Suport Only Through ADB And Also A Decent Python Interpreter Using Python For Android.
Replace "APIKEY" with your public apikey Show Sample Output
wait nginx processes. Show Sample Output
Keep retrying YOURCOMMAND until it succeeds. Add sleep between retries so that +c works. (Though you can always use +z and kill %1). Source: http://stackoverflow.com/a/5274386/2175968
Shows the WiFi signal strength without having to display thousands of lines Show Sample Output
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.
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
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: