Commands by Wrecklass (0)

  • bash: commands not found

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

use jq to validate and pretty-print json output
the `jq` tool can also be used do validate json files and pretty print output `cat file.json | jq` available on several platforms, including newer debian-based systems via `#sudo apt install jq`, mac via `brew install jq`, and from source https://stedolan.github.io/jq/download/

Speaking alarm clock
This ran on a ubuntu box using espeak for speaking text with the bash shell. On a mac you should use 'say'. Also you can change your alarm interval and your snooze interval which are currently 8 hours and 1 minute. I would run this via cron yet it's easier to disable if you run it as a command like this :P

Get absolut path to your bash-script
Another way of doing it that's a bit clearer. I'm a fan of readable code.

Shorten any Url using bit.ly API, using your API Key which enables you to Track Clicks
Shorten any Url using bit.ly API, using your API Key which enables you to Track Clicks I have it as a Function in my .bash_aliases [code] shorten () { longUrl=$1; curl "http://api.bit.ly/shorten?version=2.0.1&longUrl=LONG_URL_YOU_WANT_SHORTENED&login=rungss&apiKey=" } [/code] Here is an Output showing the Function Detail.. [konsole] bijay@bijay:$ type shorten shorten is a function shorten () { longUrl=$1; curl "http://api.bit.ly/shorten?version=2.0.1&longUrl=$longUrl&login=rungss&apiKey=R_48d7e0b40835b09e3861bd455f7abec7" } [/konsole]

E-mail a traditional Berkeley mbox to another recipient as individual e-mails.

Backup with versioning

Reverse SSH
this command from the source server and this follow in the destination server: ssh user@localhost -p 8888

'readlink' equivalent using shell commands, and following all links
This is a equivalent to the GNU ' readlink' tool, but it supports following all the links, even in different directories. An interesting alternative is this one, that gets the path of the destination file $ myreadlink() { [ ! -h "$1" ] && echo "$1" || (local link="$(expr "$(command ls -ld -- "$1")" : '.*-> \(.*\)$')"; cd $(dirname $1); myreadlink "$link" | sed "s|^\([^/].*\)\$|$(dirname $1)/\1|"); }

Edit file(s) that has been just listed
That will open vi with the four README files in different viewports. Specially handy when you find there is only one file matching your pattern and you don't want to specify the full path.

Get memory total from /proc/meminfo in Gigs


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: