diff --git a/plugins/available/cdup.plugin.bash b/plugins/available/cdup.plugin.bash new file mode 100644 index 00000000..f65ce5ce --- /dev/null +++ b/plugins/available/cdup.plugin.bash @@ -0,0 +1,17 @@ +cite about-plugin +about-plugin 'cdup - traverse parent directories with ease. inspired by a script from tyskby' + +cdup() { + if [[ $1 =~ .{2,} ]]; then + local count + + count=${1:1} + + for ((i=1; i<=${#count}; i++)); do + cd .. + done + + pwd + fi +} +