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 '^\.$'
发布时间: 2012-05-29 12:16:00 作者: rapoo
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 '^\.$'