#!/bin/bash explorer() { pwd for i in * do if [ -d $i ] then cd $i explorer cd .. fi if [ -f $i ] then echo $i fi done } explorer