Terminal aliases are used to assign an alternative name to a common action or shell command, i.e. "navigate to your coding folder" or "open a specific file or folder with vs code".
Home Folder
Linux based operating systems have a so called home folder for each user. The home folder is also represented by the $HOME env variable and (depending on the shell) by the ~ (tilde sign).
You can always navigate to your home folder by using the cd $HOMEcd ~ command.
The $HOME env variable is case sensitive ⚠️
Alias
The alias command can be used to create terminal aliases.
> alias sayhello="echo 'hello, you just created a alias'"
> sayhello
hello, you just created a alias
Shell aliases are only available during a terminal session by default.
Persist Aliases
You can also persist aliases by adding them to your terminal profile file.
Depending on the shell you are using the profile is represented by a different file.
TL;DR: run this command to find your wich shell you are using printf "My current shell - %s\n" "$SHELL"
Your terminal profile file is loaded on every start of a new terminal session, which means if you edit the file the changes will be live after you start a new terminal 💡
Edit Terminal Profile
Run Visual Studio Code to open your profile file like this /usr/local/bin/code <profileFile>.
Todos
[x] Add a folder names coding in your home directory
[x] Add an alias named code for Visual Studio Code
[x] Add an alias named coding that navigates to your coding folder
Terminal aliases are used to assign an alternative name to a common action or shell command, i.e. "navigate to your coding folder" or "open a specific file or folder with vs code".
Home Folder
Linux based operating systems have a so called home folder for each user. The home folder is also represented by the
$HOME
env variable and (depending on the shell) by the~
(tilde sign).You can always navigate to your home folder by using the
cd $HOME
cd ~
command.Alias
The
alias
command can be used to create terminal aliases.Persist Aliases
You can also persist aliases by adding them to your terminal profile file.
Depending on the shell you are using the profile is represented by a different file.
~/.zshrc
~/.bash_profile
If you are not sure what shell you are using please refer to this particular section within this article.
Your terminal profile file is loaded on every start of a new terminal session, which means if you edit the file the changes will be live after you start a new terminal 💡
Edit Terminal Profile
Run Visual Studio Code to open your profile file like this
/usr/local/bin/code <profileFile>
.Todos
coding
in your home directorycode
for Visual Studio Codecoding
that navigates to your coding folder