PDA

View Full Version : Command Line



Cyberian
9th December 2004, 08:24 AM
Hi,

I believe it is called the Command Line. It is this bar I type in the name of an application and it opens it.

1. How do I set the history to 0?

2. How do I add custom names? i.e. 'ff' will launch Firefox. Cuts my time in typing.

adam
9th December 2004, 11:06 AM
1. I think you should check your .history file.
2. bash.rc file has got a section to put 'custom name' you mention, called ALIAS I guess

imdeemvp
9th December 2004, 11:08 AM
Sometimes all you need to do is type 3-4 letters of the command and hit the TAB key, it will finish typing the command for you and just hit enter.

foolish
9th December 2004, 11:30 AM
I know this can be confusing, it's confusing to me as well.

The command line is the same thing as the terminal, which is the same thing as the shell. The shell used in Fedora is called Bourne Again SHell, or BASH. BASH is basicly a scripting language which helps you in launching commands. www.linuxcommand.org is a nice place to start when learning the command line, or terminal, or shell. It's confusingl, I know.

What you describe is known as the "Launch application" window. And it's basicly a nice way to launch a terminal command.

For how to add aliases, you have to look at your BASH configuration. In your home dir you have some hidden configuration files, hidden files start with a .

.bashrc is where you can enter user specific aliases. Simply add new lines to the file. Here's how to make an alias for firefox to "ff":


alias ff='firefox'


Remember to use tab completion when working in the terminal, type the first couple of letters of a command and press tab to have it fill in the rest automatically.

Cyberian
11th December 2004, 08:03 AM
I have edited .bashrc to:


# .bashrc

#User specific aliases and functions
alias ff='firefox'
#Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi


But it didn't work. Please further help.

Also, the tab completion doesn't work very well. I got more than one application that starts with 'fire'. I still prefer to type in 2 or 3 characters rather than the whole word as shortcuts.