Linux: The Most Fun You Can Have with your Pants On

Hey, wanna know some cool stuff you can do in a Linux terminal?

First, three keyboard tricks you probably already know.

  • The up arrow is a "history" key. After you've entered some commands, you can retrieve them with the up arrow. Most terminals will store the last several hundred commands. You can, obviously, edit these (like if the first time you entered the command it did not work because you typed it wrong).
  • The TAB is an auto completion key.
  • Many terminals do NOT use ctrl-c for copy and ctrl-v for paste, for historical reasons. But if you go to Preferences --> Shortcuts or in some cases Key Bindings, you can easily change this.

Now for a much bigger, more powerful cool thing you can do.

wget
The command wget gets stuff. Type in wget and then any valid internet address, and whatever that address points to is immediately sucked into your home directory. No questions asked. There are many, many options you can run wget with but you don't need them to get a single simple file (oh, it won't over write a file with the same name on your computer ... it will just add a dot-number to the end of the name of the newly downloaded file).

Here's an example. I've got a PDF file on the web at this location:

gregladen.com/wordpress/wp-content/pdf/Laden_Wrangham_Roots.pdf

Open a terminal, type wget, a space, then copy and paste this filename on to the terminal line and hit enter. The PDF is 233K long. Now type "ls" to get a directory and you'll see the file.

If you do this with a standard web page you may get "index.html" or something like that. If you then open the index.html file in your web browser, you get to see what a web page looks like without a style sheet attached!

Tags

More like this

Your are typing some text into your FIrefox 2.0 Browser, and you spell something terribly wrong. Like this: I am so glad I upgreaded to Firefox 2.0, because it has a built in spell checker. You see the error where you meant to type "upgraded." So you right click on it to pick the correct spelling…
This is the first in a series about using the "command line" in Linux. It is also about knowing when to use a gui instead. But before going into any of that we need to understand what is meant by a "command line" application. You'll find that as we explore that idea, a lot of things that are not…
I know all my fellow bloggers are jealous about my Linux calendar posts (like this one) and normally I don't reveal my secrets. But this is so cool I have to share it. The Linux calendar command (in the terminal window) puts out, by default, a listing of events, etc. from today and tomorrow.…
This is one of four related posts: Should You Install Ubuntu Linux? Installing Ubuntu 16.04 LTS How to use Ubuntu Unity Things To Do After Installing Ubuntu 16.04 LTS Some Linux/Ubuntu related books: Ubuntu Unleashed 2016 Edition: Covering 15.10 and 16.04 (11th Edition) Ubuntu 16.04 LTS Desktop:…

Nice post and a great headline. I think it's true though. The command line is a lot of fun once you get to know it and after it saves your butt from a world of hurt. But it's losing it's dominance as the scare tactic of choice by Microsofties to "drivers".

By Richard Chapman (not verified) on 22 Nov 2007 #permalink

I use Ctrl-R often for going back in history. Type that combo, then begin typing the command you want to recall. Retype the combo to select other matches, then hit enter when you find the one you want.

wget will also resume downloads with the -c switch, and download from a list of URLs in a text file with the -i filename.txt switch.

actually, at the command line, unless you specify otherwise, you get most of the features of a program called readline, and the emacs control key commands. though you can change it to use vi commands if you prefer... (a good way to start a religious war there...)

type "man readline" at the prompt to find the rest of the key commands, (they're a few pages in...)

M- means the alt key. C-means the control key

C-d :delete forward character
M-d :delete forward word
C-k :delete to end of line
C-y :(yank) paste what C-k just deleted
C-o :insert blank line
C-a :move cursor to beginning of line
C-e :move to the end of the line
C-p :same as up arrow
M-< :go to first command in your command history
C-t :swap the letters before and after the cursor
M-t :same, but with the whole words
C-b :move one letter to the left
M-b :move one word to the left
C-f :move one letter to the right
M-f :move one word to the right

there are lots more, these are some that I use every day... (one point to bear in mind, these control key sequences were developed when the control key was where the caps lock key is now. as a result of the moving to the lower spot that it now resides in, there is a suspicion that this may have some relation to an increase in the incidence of rsi... but there's a causation/correlation debate about that too.)

OK, I succumbed and got two XO laptops for my wife and daughter and may get another two for my son and myself. This will be the first time ever I will hold a machine with Linux on it and have no idea where to start. Is there a good place to start? A cool online tutorial? Or should I just bug you several times a day?