Welcome to my little node on the network! My name is Petar and you can follow along while I try to figure out how computers work.

Recent notes

Make and jump into directory easily

Very often - like ALL the time - you end up creating a new directory with mkdir -p some_path and then immediately typing cd some_path right after. Such a waste of typing!

Here’s a super handy little function that does both things at once. Just drop this in your config and thank me later:

For Fish:

function mkcd
    mkdir -p $argv[1]; and cd $argv[1]
end

For those that have to still learn that Fish is the best shell, here’s Bash and ZSH:

mkcd() {
    mkdir -p "$1" && cd "$1"
}

Now you can just type mkcd ~/.config/test and boom - directory created and you’re already inside it! The -p flag means it’ll create any missing parent directories too, so you can go as deep as you want. Way better than typing two commands every single time, right?

Permalink

Recent Posts

Running to think

For a few years now, I've been partaking in the age-old ritual of running. I began my journey like many others, swathed in quality athletic wear and armed with a meticulous training schedule...

Read more

Recent reads