Commands using ssh (347)

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

The proper way to read kernel messages in realtime.

Convert control codes to visible Unicode Control Pictures
Converts control codes and spaces (ASCII code ≤ 32) to visible Unicode Control Pictures, U+2400 ? U+2420. Skips \n characters, which is probably a good thing.

Join lines
Even shorter. Stolen from comment posted by eightmillion.

Given process ID print its environment variables

intercept stdout/stderr of another process

Convert seconds into minutes and seconds
This is a very simple way to input a large number of seconds and get a more useful value in minutes and seconds.

Random Number Between 1 And 256
It takes a byte from /dev/random whose source is the kernel entropy pool (better source than other solutions).

Broadcast your shell thru UDP on port 5000
Better solution in case of many clients, imo.

Kill process by pid
To kill a process in windows by using the PID. Change 10728 to the PID of the process you want to kill.

repeat a command every one second
Short method of "while x=0; do foo ; sleep 1 ; done"


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: