How to strip leading “./” in unix “find”?

前端 未结 7 1934
盖世英雄少女心
盖世英雄少女心 2020-11-29 17:14
find . -type f -print

prints out

./file1
./file2
./file3

Any way to make it print

file1
file2
fil         


        
7条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 17:35

    Since -printf option is not available on OSX find here is one command that works on OSX find, just in case if someone doesn't want to install gnu find using brew etc:

    find . -type f -execdir printf '%s\n' {} + 
    

提交回复
热议问题