From bec0c679e6380c63f3f1ff45c0af267418d8fe30 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 17 Jan 2013 14:32:39 +0100 Subject: [PATCH] Add an up function, to cd .. several times --- .bashrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.bashrc b/.bashrc index 170b559..0bc5b9f 100644 --- a/.bashrc +++ b/.bashrc @@ -53,6 +53,19 @@ function del() done } +# go up n directories +up() +{ + local str="" + local count=0 + while [[ "$count" -lt "$1" ]] ; + do + str=$str"../" + let count=count+1 + done + cd $str +} + # move backup files to trash alias clean='mv *~ ~/.Trash/'