Things I wish I had knew earlier.

Most of the tips are from here

Basics

Navigation to any folder

> cd /home/andras/Projects/data_science_blog/
/home/andras/Projects/data_science_blog

With the ~ we can jump to our home folder

> cd ~
/home/andras

cd

We do not even need the ~ to navigate to our home folder.

> cd /
/
> cd
/home/andras

Bash function

We can also create a bash function so we can spare even typing cd

Here is the function

# .bashrc

function blog() {
    cd "$HOME/Projects/data_science_blog"
}

And jump!

> blog
/home/andras/Projects/data_science_blog

Symbolic link

An another possible way is to create a symbolic link in our home folder.

> ln -s ~/Projects/data_science_blog/ dsblog
> ls -l ~/dsblog
lrwxrwxrwx 1 andras andras 40 okt    4 10:39 /home/andras/dsblog -> /home/andras/Projects/data_science_blog/

And jump!

> cd ~/dsblog
/home/andras/dsblog

However, because of the way symbolic links work, our ‘parent’ folder is still the home directory.

> cd ..
/home/andras

cd -

With - we can jump back to our previous folder

> cd -
/home/andras/Projects/data_science_blog

Path variable in .bashrc

A further option is to create a variable in bash

# .bashrc
BLOG=/home/andras/Projects/data_science_blog
cd $BLOG
/home/andras/Projects/data_science_blog

Create an alias

# .bashrc
alias ds_blog="cd /home/andras/Projects/data_science_blog"
> ds_blog
/home/andras/Projects/data_science_blog