Useful configurations
Ok, so what useful things can we put in a Bash profile? The answer is anything one can think of that makes doing computing easier. Here are a few simple examples:
-
alias - It is cumbersome to type lengthy commands over and over. Instead make a new command using an alias!
-
Consider this option:
-
alias interact="salloc
--account=microbiome
--time=1:45:00
--nodes=1
--ntasks-per-node=1
--cpus-per-task=1
--mem=2000"
-
-
If I add this alias into my Bash profile, then the next time I open up a new Shell I can simply type interact on the command line and the computer interprets this as requesting an interactive session with the aforementioned specifications. Pretty handy.
-
alias ll="ls -laF"
alias ls="ls -F"
alias rm="rm -I" # make rm interactive
alias mv="mv -i" # make mv interactive
alias cp="cp -i" # make cp interactive
-
-
Set environmental variables - one can set or modify environmental variables for the shell. For instance, if one wants to change the $PATH then this can be specified in the Bash profile. See this explanation of PATHs, a definition by The Linux Information Project (LINO), if you don't know what a $PATH is:
-
PATH=$PATH:~/bin:.
# append ~/bin and ./ (current directory) to the PATH -
Modified environmental variables need to be exported at the end of the configuration: export PATH
-
-
Lots and lots of recipes exist for putting useful things in a Bash profile. Do some Googling and then get creative. You will likely find lots of convenient ways to improve your computing experience through modification of the Bash profile.
Note that if you edit your profile in Nano to save and exit the program see the instructions at the bottom of the editing window.