User Tools

Site Tools


setting_up_your_terminal_environment

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
setting_up_your_terminal_environment [2021/05/11 22:28] 168.91.18.151setting_up_your_terminal_environment [2023/07/25 12:02] (current) – [The Terminal] 134.190.232.186
Line 1: Line 1:
 Documentation by Joran Martijn (11 May 2021) Documentation by Joran Martijn (11 May 2021)
 +
 +==== The Terminal ====
  
 By default the terminal is a very monotone and hard to navigate. The prompt is indistinguishable from the commands and the output, and the 'ls' output looks the same whether they are files or directories. We can configure our terminal experience by modifying the so-called ''.bashrc'' file. By default the terminal is a very monotone and hard to navigate. The prompt is indistinguishable from the commands and the output, and the 'ls' output looks the same whether they are files or directories. We can configure our terminal experience by modifying the so-called ''.bashrc'' file.
  
 The ''.bashrc'' file is loaded whenever you open a new terminal session, either by simply opening the Terminal program or by SSHing into a remote server. The ''.bashrc'' file is loaded whenever you open a new terminal session, either by simply opening the Terminal program or by SSHing into a remote server.
 +
 +NOTE: Logging into Perun seems to be an exception and does not load the ''.bashrc'' by default on login. It instead attempts to load the ''.bash_profile'' file, which is also located in your home folder. If you don't have it, simply create it via ''touch ~/.bash_profile'' and then edit it so it includes the following
 +
 +<code>
 +if [ -f $HOME/.bashrc ]; then
 +        source $HOME/.bashrc
 +fi
 +</code>
 +
 +Now, when you login, the ''.bash_profile'' is loaded, which in turn loads the ''.bashrc'' file.
  
 === Adjusting the look of the prompt === === Adjusting the look of the prompt ===
Line 39: Line 51:
  
 === Moving around efficiently === === Moving around efficiently ===
 +
 +Moving around on the filesystem can demand a lot of key strokes, especially if you need to type a very long cd command. I find it very useful to "mark" commonly visited locations in the filesystem, such as base directories of certain projects or directories where you store your git repositories or scripts by setting a number of aliases. Add these to your ''.bashrc'' :
 +
 +<code>
 +alias cdscripts='cd /path/to/scripts'
 +alias cdproj1='cd /path/to/proj1'
 +alias cdproj2='cd /path/to/proj2'
 +</code>
 +
 +In addition, invoking ''cd'' will take you to your home directory, and ''cd -'' takes you to the previous directory you were in
 +
 +=== Other useful aliases ===
 +
 +<code>
 +## editor shortcuts
 +alias e='emacs -nw'
 +alias v='vim'
 +
 +## common commands
 +alias a='source activate'
 +alias d='conda deactivate'
 +alias editb='emacs -nw ~/.bashrc'
 +alias loadb='source ~/.bashrc'
 +</code>
  
  
setting_up_your_terminal_environment.1620782927.txt.gz · Last modified: by 168.91.18.151