FavoriteLoadingAdd to favorites

Step 1 :
Find your .bashrc file

Step 2 :
(.bashrc is found in root directory)
(You can type cd in the terminal and hit enter to get to root and use ls -la to see list of files in directory)
– Edit your .bashrc file. Use whatever editing tool of your choice.
or you can just edit in the terminal with the below command :
nano .bashrc
Once you are in the file proceed to step 3.

Step 3 :
Go to the bottom of you .bashrc file and look for something along the lines of the below :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
 
 
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

Step 4 :
Add a comment above the snippet indicated above so it looks like this.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#Custom Bash Commands
# Commands will be listed here...
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#Custom Bash Commands # Commands will be listed here... export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#Custom Bash Commands
# Commands will be listed here...

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

Step 5 :
Add your commands. 1 per line! use semi-colon ( ; ) to run multiple commands in succession

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#Custom Bash Commands
alias my_custom_bash_command="do something in bash code"
alias my_custom_bash_command2="do something in bash code"
alias my_custom_bash_command3="do something in bash code"
alias my_custom_bash_command4="do something in bash code"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#Custom Bash Commands alias my_custom_bash_command="do something in bash code" alias my_custom_bash_command2="do something in bash code" alias my_custom_bash_command3="do something in bash code" alias my_custom_bash_command4="do something in bash code" export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#Custom Bash Commands
alias my_custom_bash_command="do something in bash code"
alias my_custom_bash_command2="do something in bash code"
alias my_custom_bash_command3="do something in bash code"
alias my_custom_bash_command4="do something in bash code"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion


Pin It on Pinterest

Garth Baker
Favorite
Loading
en
af
sq
am
ar
hy
az
eu
be
bn
bs
bg
ca
ceb
ny
zh-CN
zh-TW
co
hr
cs
da
nl
en
eo
et
tl
fi
fr
fy
gl
ka
de
el
gu
ht
ha
haw
iw
hi
hmn
hu
is
ig
id
ga
it
ja
jw
kn
kk
km
ko
ku
ky
lo
la
lv
lt
lb
mk
mg
ms
ml
mt
mi
mr
mn
my
ne
no
ps
fa
pl
pt
pa
ro
ru
sm
gd
sr
st
sn
sd
si
sk
sl
so
es
su
sw
sv
tg
ta
te
th
tr
uk
ur
uz
vi
cy
xh
yi
yo
zu
Share This