首页 / 操作系统 / Linux / linux查找可执行文件的方法
linux下查找可执行文件
ls -F|grep "*"
这样就可以了!
ls -F | grep /$是什么意思
ls -F的意思是把文件按照类型归类,并且在末尾加上/ *等符号标识
| 管道输出,把前面命令的结果当做输入传给后面的命令
grep /$的意思是从中挑出以/结尾的行,/就是标识是目录
-F, --classify
append indicator (one of */=>@|) to entries
例子:
复制代码代码如下:
[root@SOR_SYS ~]# ls -F
1.sh* CC_manual_0701.rargzpackage/man.configscript/ tr1.txt
2005.03.01dead.letter index.htmlntpd-deploy.sh* start_tomcatServer229-1.shtr.txt
anaconda-ks.cfg Desktop/install.log printc.sh start_tomcatServer229-2.sh usr/
apache-tomcat-6.0.30.zipetc/install.log.syslogrpmpackage/stop_tomcatServer229-1.sh zy/
camptocamp-tomcat-0.0.1/get_date.sh lib/ ruby-1.8.7-p248/stop_tomcatServer229-2.sh zy.bak/
[root@SOR_SYS ~]#
如果我们搜索以/结尾的,我们可以用以下方法:
ls -F|grep /【转义字符】
ls -F|grep /$
ls -F|grep /
我们来看看ls -F的作用:
-F开关对可执行文件添加一个*号,为目录添加一个/号,为符号链接添加一个@号。