Advertisement
metalx1000

list all files recursively without 'ls' or 'find'

Jul 29th, 2016
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.17 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. search() {
  4.   local d
  5.   for d in *; do
  6.     if [ -d "$d" ];
  7.     then
  8.       (cd "$d" && search)
  9.     else
  10.       echo "$(pwd)/$d"
  11.     fi
  12.   done
  13. }
  14. search
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement