For example, instead of typing ls -alFs | more you can make your account perform the same action (listing files) by aliasing the command to just l.
You can make temporary aliases, or, for often-used commands, you can make permanent aliases.
The alias command can be used three ways.
Entering the alias command all by itself (with no arguments) lists all active aliases (there are several aliases which are pre-set for all Unity accounts).Entering the command alias name displays the named alias' definition. For example, entering alias goto results in
[sparc03]...kaputnik>alias goto set d1 = $cwd; cd !^ [sparc03]...kaputnik> The goto command is clearly easier to type and remember than what it stands for!
You can create temporary aliases of your own by following the syntaxalias name definition
where you replace name with the name of the alias and definition with the definition of the new alias.
Where name is the abbreviation you want to use in place of the big, nasty Unix command, and definition is the actual Unix command you want to replace.
Entering the alias at the command line creates a temporary alias.
For example, you can set cls to substitute for the clear command, which clears the screen, by entering
alias cls clear
Or you could establish an alias for the ls command (which lists files) that includes the -s option (which provides the size of the files) by entering
alias l ls -s
Aliases created in this way, however, will be active only for the current session. When you logout, your alias is lost.
To create permanent aliases you must modify your ".mycshrc" file. Open the file with an editor (such as Pico or TED) and type the alias command you wish to activate. Be sure to put the command on a single line. The alias will be active until it is removed from the file, or until you use the unalias command on that alias (see below).For more information about customizing your environment see Customizing your Unity account.
To remove a temporary aliase use the command unalias name.For example, if you had set scan as an alias for the command sequence more -cs, you would remove the alias by entering unalias scan.
Using the unalias command on a permanent alias (one which is defined in your ".mycshrc" file) removes the alias for that session only. When you logout and then login again the alias will still be in effect.
To remove a permanent alias permanently you must remove the line in your ".mycshrc" file which defines it.
Go back to the tutor page.