CS155 Customization
csh
reads from ~/.cshrc
bash
reads from ~/.bashrc
ksh
reads from ~/.kshrc
zsh
reads from ~/.zshrc
rc
files?
~/.cshrc
contains C-shell syntax,
~/.bashrc
contains commands in the style of bash
, etc.
bash
.
Customization usually means setting environment variables.
export var="value" export TZ="America/Denver"
Remember, all examples from now on are bash
only.
date
is often
spawned by the shell, so it’s a “child” of the shell.
To help the shell find programs directory /newbin
, add it to the
beginning of the environment variable PATH
:
export PATH="/newbin:$PATH"
Why did we use "double quotes" as opposed to 'single quotes'?
To change your interactive prompt, set the appropriate variable:
PS1="$USER> "
Why didn’t we use export
? That’s because this variable is
private to the shell, and not for the user of other programs.
To create a new command, use alias
:
alias hi="echo Howdy!" unalias hi alias h="history" alias mkx="chmod u+x"
% rm -f x y % umask ugo=rwx % touch x % umask u=rwx,g=r,o= % touch y % ls -l x y -rw-rw-rw- 1 cs155 class 0 Feb 14 20:45 x -rw-r----- 1 cs155 class 0 Feb 14 20:45 y
umask
sets the default permissions for new files.
umask
of ugo=rwx
is very trusting
umask
of u=rwx,go=
is paranoid.
umask
in ~/.bashrc
file.
Modified: 2015-07-31T12:58 User: Guest Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |