← Back to context

Comment by ladybanshee

5 hours ago

Could you explain the purpose of mkcd?

Not the author, but my first guess is to create a folder and cd into it with just one command instead of 2 with the said argument, isn't it ?

  • Exactly. It's a small quality-of-life feature to avoid the repetitive mkdir && cd sequence. In GRSH, it also ensures the directory is created with the necessary permissions before the shell attempts to switch into it.

It’s a shortcut

Its purpose is to combine mkdir -p and cd into a single atomic-like action. Instead of typing: mkdir -p my_project && cd my_project

You simply run: mkcd my_project

It's designed to reduce friction during development, especially when you're frequently creating new nested directory structures.