Tilde expansions

An unquoted tilde character (~) at the beginning of a word is expanded according to the following rules:

Examples

  1. Change the current directory to the user's home directory:
    cd ~
    
  2. Change the current directory to the bin directory in user smith's home directory:
    cd ~smith/bin