SzabiSch / bootcamp-schedule

0 stars 0 forks source link

Setup: Aliases and Terminal Profile #9

Closed codingbootcampseu closed 3 years ago

codingbootcampseu commented 3 years ago

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.

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.

If you are not sure what shell you are using please refer to this particular section within this article.

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