Skip to content

Instantly share code, notes, and snippets.

@dtkav
Last active September 2, 2016 02:03
Show Gist options
  • Save dtkav/8246705 to your computer and use it in GitHub Desktop.
Save dtkav/8246705 to your computer and use it in GitHub Desktop.
dug: cd to bottom of directory tree (if you have several singly nested folders)
function dug() {
ls -d */ >/dev/null 2>&1;
if [[ $? -eq 0 && `ls -d */ | wc -l` -eq 1 ]];
then
builtin cd `ls -d */`;
dig;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment