0

I have used the find command to get the following list of sub-folders:

$ find -mindepth 1 -maxdepth 2 -type d
./aa/one
./bb/two
./cc/three

How can I remove ./**/?

Expected result:

one
two
three
Inian
  • 80,270
  • 14
  • 142
  • 161
Luca
  • 41
  • 4

1 Answers1

2
$ echo "./aa/one
./bb/two
./cc/three" | sed 's@^.*/@@'
one
two
three

or better use this instead:

find -mindepth 1 -maxdepth 2 -type d -printf "%f\n"
riteshtch
  • 8,629
  • 4
  • 25
  • 38
  • thanks for the help ! – Luca May 05 '16 at 08:34
  • @Luca since you're new here, don't forget to mark the answer accepted whenever it helped (most) in understanding and solving the problem. See also [How does accepting an answer work?](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235) – fedorqui May 05 '16 at 09:13