#!/bin/sh # rd: rename current directory # rd "new-name" [ "$1" = "" ] && echo "rd: rename directory: new name missing" && return curr="$(basename "$(pwd)")" cd .. mv "$curr" "$1" cd "$1" || return