SHARE
Facebook X Pinterest WhatsApp

Command-Line-Fu, Because Knowledge is Power

Written By
thumbnail Juliet Kemp
Juliet Kemp
Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



The amazing versatility of the Linux command-line is a happy and joyous thing, but it also means that however experienced you are, there’s always something that you
haven’t come across before. Command-Line-Fu is a one example. It is a collection of user-submitted command lines (from the short to the line-noise long) that web site visitors vote up or down. You can check
out the current most popular ones here
.

Tip of the Trade: This social networking site makes broadening your command-line knowledge fun and easy.

The very top one when I looked, sudo !!, is something that I knew
the pieces of but for some reason never thought of putting together:
!! is a reference to the last command issued, so sudo !!

runs that under sudo. Perfect when you’ve just run something and got
“permission denied”, and quicker than my usual method of using the up arrow
and then Ctrl-A to go to the start of the line.

^foo^bar was also new to me: This runs the previous command but with bar replacing foo. This won’t always be faster than just recalling the command and editing it, but it’s a useful trick.

Possibly more useful is that the default argument is empty. So if you typo a command with an extra letter, you can rerun it with this. For example, ssh myxcomputer, recalled by ^x, would run as ssh mycomputer. Note that it changes only the first occurrence, so it can also be useful in fixing doubled-up letter typos.

There’s plenty more useful stuff at the web site. It’s well worth checking out
and contributing to. You can even get new additions sent to you via Twitter.

thumbnail Juliet Kemp

Juliet Kemp is a ServerWatch contributor.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.