Three hacks and commands to use in your terminal.

antonrich

Anton

Posted on November 1, 2018

Three hacks and commands to use in your terminal.

The first one is:

du -sh */ | sort -rh | head -6

This command will show 6 heaviest folders.

du - disk usage

| - pipe. Which works like pipes in Elixir and Elm.

Basically, the output of the first function becomes an input for the next function and so on.

head - shows only a certain amount of output.

The second one:

Turn this >

A terminal with a long line before the dollar sign

into this >

a terminal with just a dollar sign

Just add this to your ~/.bashrc:

PS1='\$ '

After that you need to restart your bash:

source ~/.bashrc

Also, there are different ways to restart your bash.

There are more ways you can set this up check out this overflow to find out more.

The third one:

Creating folders with a pattern. Recently I had to create 8 folders for my codewars challenges:

mkdir kyu_{1..8}

I unfortunately don't remember where I find out about this command.

Oh, I just found it. It's here.

💖 💪 🙅 🚩
antonrich
Anton

Posted on November 1, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related