Useful terminal commands to keep workspace clean

Reading Time: < 1 minute

1. Find and delete all empty folders in the directory

find . -empty -type d -delete

Source: https://askubuntu.com/a/73711

2. Find and delete all the branches, that no longer has tracked a remote branch

git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done

Source: https://stackoverflow.com/a/33548037/4213708

The post will be updated.

If you are using any terminal commands repeatedly, please, share them in the comments.

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Olena Sovyn
Senior Software Engineer (London, UK). I ❤ React, Redux, lodash, React Storybook, and functional programming overall. Always open for learning something new

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Spelling error report

The following text will be sent to our editors: