服务器之家:专注于服务器技术及软件下载分享
分类导航

Linux|Centos|Ubuntu|系统进程|Fedora|注册表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服务器之家 - 服务器系统 - Linux - linux查找可执行文件的方法

linux查找可执行文件的方法

2019-11-14 16:02linux教程网 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.rar gzpackage/ man.config script/ tr1.txt
2005.03.01 dead.letter index.html ntpd-deploy.sh* start_tomcatServer229-1.sh tr.txt
anaconda-ks.cfg Desktop/ install.log printc.sh start_tomcatServer229-2.sh usr/
apache-tomcat-6.0.30.zip etc/ install.log.syslog rpmpackage/ 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开关对可执行文件添加一个*号,为目录添加一个/号,为符号链接添加一个@号。

延伸 · 阅读

精彩推荐