summaryrefslogtreecommitdiffstats
path: root/.bashrc
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-05-21 14:16:13 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-05-21 14:23:22 +0200
commit46e95eea21365c8160808e8414a4cae859e46cdd (patch)
tree8ac72ec40a540d5681ee86dcd95374ead076dd51 /.bashrc
parent4860f0ac9eaccbc2edd8190ad4f3606d8b8a18b6 (diff)
downloaddotfiles-46e95eea21365c8160808e8414a4cae859e46cdd.tar.gz
dotfiles-46e95eea21365c8160808e8414a4cae859e46cdd.tar.xz
dotfiles-46e95eea21365c8160808e8414a4cae859e46cdd.zip
.bashrc: add cdup function (stands for repeated cd ..)
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc7
1 files changed, 7 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
index afa7b7f..cf737c7 100644
--- a/.bashrc
+++ b/.bashrc
@@ -53,3 +53,10 @@ sec-wx-mem() {
| perl -ne 'm!^(/proc/(\d+))/.*! and printf qq(%5d %s\n), $2, `cat $1/cmdline`' \
| tr '\0' ' '
}
+
+cdup() {
+ local up="."
+ for i in $(seq 1 $1); do up+="/.."; done
+ cd "${up}" 2>/dev/null || :
+ unset up
+}