日期:2014-05-16  浏览次数:20621 次

shell 查找目錄, 只顯示目錄名. 怎麼做?
目錄結構如下:
/App/XX1-7XX/a1.app
/App/XX4-XXX/a2.app
/App/XX6-7XX/a3.app
/App/XX3-XXX/a4.app
我需要的結果是:
a1.app
a2.app
a3.app
a4.app
我試用find ls 顯示的都是絕對路徑. 
有沒有簡單辦法 只顯示目錄名.
謝謝.

------解决方案--------------------
find . | sed -r 's/.*\/(.*)/\1/g' | egrep -v '^\.$'