9 ms·
A function, not an alias, but I've found it useful when working on deeply-nested projects/dirs: function up { if [[ "$#" < 1 ]] ; then
by ubertaco 11y ago
A function, not an alias, but I've found it useful when working on deeply-nested projects/dirs:
function up {
if [[ "$#" < 1 ]] ; then
cd ..
else
CDSTR=""
for i in {1..$1} ; do
CDSTR="../$CDSTR"
done
cd $CDSTR
fi
}
I can just run "up" to "cd ..", or I can run "up 6" to "cd ../../../../../.."