[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] mkdir: Add a -c (change dir) flag
From: |
Pádraig Brady |
Subject: |
Re: [RFC] mkdir: Add a -c (change dir) flag |
Date: |
Sat, 29 Feb 2020 20:30:00 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Thunderbird/73.0 |
On 29/02/2020 20:20, Tamir Carmeli wrote:
I suggest to add a "-c, --change_dir" flag to mkdir.
This could shorten commands such as "mkdir awesome_dir && cd awesome_dir".
I tried looking if someone has already made this suggestion and
couldn't find any.
If someone thinks it's a good idea I am willing to work on a patch.
It wouldn't work within mkdir, because as soon as that process exits
the working directory would revert back to that of its parent.
I use the following function, setup in my .bashrc:
md () { mkdir -p "$1" && cd "$1"; }
cheers,
Pádraig