You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open a new terminal window, confirm that it is in your home directory by typing cd
look for the following two (hidden) files in your home directory: .bashrc or .bash_profile. If they don't both exist, create them: touch ~/.bashrc ~/.bash_profile2
open the .bashrc file with the command vi ~/.bashrc
press I to enter insert mode, and copy the following block into the file:
[[ -s ~/.bash_aliases ]] && source ~/.bash_aliases
press esc to enter command mode, then type :wq and press enter to save and exit.
open the .bash_profile file in the same way: vi .bash_profile
press I to enter insert mode, and copy the following block into the file:
[[ -s ~/.bashrc ]] && source ~/.bashrc
again, press esc to enter command mode, then type :wq and press enter to save and exit.
create the .bash_aliases file with the following command: touch ~/.bash_aliases
open the file with vi: vi ~/.bash_aliases
press I to enter insert mode, and paste in the large block of text below.
save and exit, <esc> :wq <enter>
finally, type source .bash_profile to load all the aliases.
confirm the aliases load when you start a terminal by exiting your terminal and restarting. Type alias and press enter, and you should see the list below.
## directory aliases#alias ll='ls -l'alias lla='ls -la'alias cd..='cd ..'## git aliases#alias ga='git add'alias gc='git commit -m'alias gpo='git push origin'alias gs='git status'## class-centric aliases## change this to the full directory where your Code 201 classwork existsalias 201='cd ~/Documents/Code201/labwork'## bash management aliases#alias edbash='vi ~/.bashrc'alias edal='vi ~/.bash_aliases'alias newdot='source ~/.bashrc'
footnotes
touch is a utility that creates a file if it doesn't exist.