Tip of the Week 2005-07-25
From FedoraNEWS.ORG
Welcome to Tip of the Week!
Tip of the Week releases on every monday with Fedora Weekly News.
Tip of the Week: Time Saving Terminal Tips
This will help you save time while using the BASH terminal - submitted by Carlos Peraza
There are a couple of tricks you can use to save time in a BASH terminal, by making use of BASH's history, silently stored in the file ~/.bash_history. These work in all BASH terminals, including Konsole, XTerm and gnome-terminal.
Here are a couple of Tips:
- If you press the up, or down arrow, then BASH will cycle through the list of recently used commands
- If you type part of a command, and then press <tab>, BASH will finish the command name for you. If there is more then one command, all of them are displayed on pressing <tab> again (see Command 2 in screenshot)
- If you type part of a filename, and then press <tab>, then BASH will finish the filename for you. Again, if there is more than one option, all are diplayed on pressing <tab> again (see Command 3 in screenshot)
- Press ctrl-R. A search box comes up for you to find previous commands
- ! commands - This will search the History and execute a command. The command will be displayed before execution (See Commands 4-6). There are 5 ways you can use the ! in BASH
- !! - Execute The Last Command
- !x - Execute The Last Command Starting with x
- !-n - Execute The nth from last Command
- !?abc - Execute The last Command that contained abc
- !n - Execute The nth Command in history (not very useful)
- If you press alt-. then the last parameter you passed to any command will appear at the cursor. See Command 8. I presses alt-. once, and myfile1 came up. I pressed it twice and myfile2 came up, etc...
- ctrl-U and ctrl-K 'cut' from the cursor to the beginning and the end of the line respectively. This can later be pasted using ctrl-Y
PS: Do You Want to Know how I got that Quote to Show up when I opened the Terminal? Its in Here: Tips of the IceBurg
I was counting my commands by executing this command
export PS1="\nThis is Command Number \#: "
Previous Tips of the Week Can be found Here: Tips of the IceBurg
Add a Tip
If you have a tip you want to add, contact Tejas Dinkar (mailto:tejasdinkar@gmail.com).


