loading...

Discussion on: Linux's commands and tricks I'm using in my daily job as a developer

Collapse
simonced profile image
simonced

Those are great tips.

In the terminal, one trick I like is going back to previous folder with

cd -

(that is a minus sign)

Say, you are in /var/logs and you cd /data/dev/myproject, then you can go back to logs with cd -.

Useful in some situations only, but quite handy nonetheless.

Collapse
savage profile image
Jason A Savage

Wow. I've been using cd $OLDPWD

Thanks

Collapse
araslanove profile image
Araslanov Eugene

This also works in git

  git checkout -
Thread Thread
luanfonceca profile image
Luan Fonseca

A lot of git commands works with the -

Like:

(my-branch*) $ git checkout develop
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.

(develop*) $ git checkout my-branch
Switched to branch 'my-branch'

(my-branch*) $ git merge -
Already up-to-date.