5.10. Shell Command Aliases

Aliases are a shell-dependent feature. The default shells that are part of the FreeBSD base system have the following ways to define aliases:

5.10.1. Create Aliases Interactively

As you type commands in your /bin/sh prompt, try this:

% alias ls='/bin/ls -FG'

In tcsh, the '=' sign is not necessary but pay very careful attention to the quoting of special characters, because tcsh(1) is picky:

% alias ls /bin/ls -FG

5.10.2. Create Aliases In Startup Files

Whatever you type in the command line can be stored in a shell startup script, making it effectively persistent across login sessions. Each shell has its own startup files; sh(1) uses .profile' and `.shrc', while tcsh(1) reads `.tcshrc', `.login', and `.logout'.