| Start |
|---|
| Absolute vs relative directories To change to an absolutely specified directory, use the entire name, starting with a backslash If you want to change to a directory near your current on, you can specify a relative location. For example, if you are already in If you want to go to the directory above the current directory, you can use the alias This may also be called going "up" a directory. |
| Change to the last directory For the current shell, this takes you to the previous directory that you were in, no matter where it was. Doing it multiple times effectively "toggles" you being in the current directory or the previous one. |
| Change to the home directory The default directory is the home directory ( Or you could be more explicit: A shortcut for the home directory is |
| Change to the Directory of the Script In general, there are two types of Bash scripts:
For the second type of scripts, it is useful to change to the directory where the script is stored. This can be done with the following command: This command runs 3 commands:
|
Read Article
https://develop.horje.com/learn/1434/reference