aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/mkcd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d/mkcd.sh')
-rw-r--r--sh/shrc.d/mkcd.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/sh/shrc.d/mkcd.sh b/sh/shrc.d/mkcd.sh
new file mode 100644
index 00000000..6342d4a6
--- /dev/null
+++ b/sh/shrc.d/mkcd.sh
@@ -0,0 +1,4 @@
+# Create a directory and change into it
+mkcd() {
+ mkdir -p -- "$1" && builtin cd -- "$1"
+}