Bash – Special Shell Variables

Special Shell Variables

Variable Meaning
$0 Filename of script
$1 Positional parameter #1
$2 - $9 Positional parameters #2 – #9
${10} Positional parameter #10
$# Number of positional parameters
"$*" All the positional parameters (as a single word) *
"$@" All the positional parameters (as separate strings)
${#*} Number of command line parameters passed to script
${#@} Number of command line parameters passed to script
$? Return value
$$ Process ID (PID) of script
$- Flags passed to script (using set)
$_ Last argument of previous command
$! Process ID (PID) of last job run in background

* Must be quoted, otherwise it defaults to « $@« .

Bash – /usr/bin/find: Argument list too long

Permet de déplacer tout (ou partie) d’un répertoire (rep1) vers un autre (rep2).

find . -type f -name '*' -exec mv {} rep2/. \;

En savoir plus

Bash – Configuration .bashrc

export HISTSIZE=50000;
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias agi="sudo apt-get install"
alias agu="sudo apt-get update"
alias acs="sudo apt-cache search"
SSH_KEY=`ssh-add -l`
if [ "$SSH_KEY" = "The agent has no identities." ]; then
ssh-add /home/***/.ssh/id_dsa
fi
#RSH
export CVS_RSH=/usr/bin/ssh

Recent Tweets

Catégories