wiki:Shells and Customization

Version 1 (modified by cdelarcuz, 20 years ago) ( diff )

--

Bash

Zsh

Aliases

Aliases are a nice way to customize your shell. They allow the shell to interpret a command with the exact options that you want without having to type them in all the time. You can also specify a shorter string to execute a longer command. The syntax is alias alias-name=command . If the command contains spaces, you must enclose it within quotes. Here are some examples:

$> alias ll=ls -l $> alias f=finger

In the first example, you can get a long directory listing in any given directory by typing ll. In the second example, you can finger user jones by typing f jones . Path To set your path, or other environmental variables, you use a syntax similar to ksh or sh. The syntax is export Variable=Value . Here is an example of adding the bin directory in your home directory to your path. $> export path=($path $HOME/bin ) .zshrc

The .zshrc file is exected each time you start up a new shell. This would be executed any time you logged onto a machine or statred up an xterm. .zlogin

The .zlogin file is executed when your start up a new login shell. This occurs when you log onto a computer remotely or when your start an xterm with xterm -ls . .zshenv The .zshenv , is the usual place to set your environmental variable such as your path. Sample startup files can be found in /usr/local/etc . They will have the same names, only without the leading dot.

Note: See TracWiki for help on using the wiki.