Commands by unixmonkey44446 (2)

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

Run any GUI program remotely
$ ssh -X example.org xeyes The SSH server configuration requires: X11Forwarding yes # this is default in Debian And it's convenient too: Compression delayed

live ssh network throughput test
connects to host via ssh and displays the live transfer speed, directing all transferred data to /dev/null needs pv installed Debian: 'apt-get install pv' Fedora: 'yum install pv' (may need the 'extras' repository enabled)

execute your commands and avoid history records
$ secret_command;export HISTCONTROL= This will make "secret_command" not appear in "history" list.

List the size (in human readable form) of all sub folders from the current location
Simple and easy to remember. -h is human, -d1 = depth 1. disk usage, human, depth 1

clear the X clipboard
Clears your clipboard if xsel is installed on your machine. If your xsel is dumb, you can also use $xsel --clear --clipboard

display systemd log entries for sshd using "no-pager" (a bit like in pre-systemd: grep sshd /var/log/messages)
In pre-systemd systems, something like: "# grep sshd /var/log/messages" would display log events in /var/log/messages containing "sshd". # journalctl -u sshd --no-pager The above command displays similar results for systemd systems. (Note that this needs to be run with root permissions to access the log data.)

check open ports without netstat or lsof

Optimal way of deleting huge numbers of files

shutdown pc in 4 hours without needing to keep terminal open / user logged in.
This way, you can specify how many hours in which you want your machine to shut down.

Recursive replace of directory and file names in the current directory.
This should work anywhere perl and grep is available. :P


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: