All commands (14,187)

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

lists files and folders in a folder
lists files and folders in a folder with summary.

Creates a SSHFS volume on MacOS X (better used as an alias). Needs FuseFS and SSHFS (obvioulsly).
To make it even more practical, make sure you can login to the ssh server using a keypair.

Restart openssh-server on your Synology NAS from commandline.
The correct way to restart openssh-server on your synology nas.

Reboot without being root
For more, See: https://github.com/noureddin/bash-scripts/blob/master/user_scripts/userpower

Print a great grey scale demo !
Seen here: http://www.pixelbeat.org/docs/terminal_colours/

Averaging columns of numbers
This example calculates the averages of column one and column two of "file.dat". It can be easily modified if other columns are to be averaged.

Print just line 4 from a textfile
Prints the 4th line and then quits. (Credit goes to flatcap in comments: http://www.commandlinefu.com/commands/view/6031/print-just-line-4-from-a-textfile#comment.)

Find the package a command belongs to on Debian

Rapidly invoke an editor to write a long, complex, or tricky command
Next time you are using your shell, try typing ctrl-x e (that is holding control key press x and then e). The shell will take what you've written on the command line thus far and paste it into the editor specified by $EDITOR. Then you can edit at leisure using all the powerful macros and commands of vi, emacs, nano, or whatever.

directly ssh to host B that is only accessible through host A
Of course you need to be able to access host A for this ;-)


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: