On GNU versions of find you can use -executable:

find . -type f -executable -print
For BSD versions of find, you can use -perm with + and an octal mask:

find . -type f -perm +111 -print
In this context "+" means "any of these bits are set" and 111 is the execute bits.

Note that this is not identical to the -executable predicate in GNU find. In particular, -executable tests that the file can be executed by the current user, while -perm +111 just tests if any execute permissions are set.

Older versions of GNU find also support the -perm +111 syntax, but as of 4.5.12 this syntax is no longer supported. Instead, you can use -perm /111 to get this behavior.

--列出当前目录所有可执行文件
find . -type f -perm +111 -exec ls -l {} \;
--删除当前目录所有可执行文件
find . -type f -perm +111 -exec rm -f {} \;

Unix删除当前目录可执行文件的更多相关文章

  1. PHP删除当前目录及其目录下的所有文件

    使用PHP遍历一个目录下的所有目录及文件,并删除该目录及其目录下的所有子目录和文件,本次代码通过递归的方式来实现. 用到的函数: scandir($path) 遍历一个目录下所有文件并返回数组. un ...

  2. SVN莫名出错,网上找遍无果,递归删除当前目录下所有.svn文件名

    哎,太深刻的教训. 原来以前其它目录里有.SVN目录 ,而此SVN目录COPY到真正的SVN工作目录之后,会将有用的.SVN目录覆盖. 那么一样,显然,CI,UPDATE,CO之间的命令全部异常... ...

  3. windows批量删除当前目录以及子目录的所有空文件夹

    在桌面创建一个记事本,将以下内容复制粘贴到记事本中,将记事本的拓展名修改为bat即可,然后将该文件放到需要执行的目录双击. @echo off setlocal enabledelayedexpans ...

  4. [BAT] 通过批处理删除7天前的报告,并删除当前目录下的空文件夹

    set reportPath=D:\AutomationReport cd /d %reportPath% forfiles /p %reportPath% /s /m *.xml /d -7 /c ...

  5. Linux: 删除当前目录下的所有__pycache__子目录

    find . -name '__pycache__' -type d -exec rm -rf {} \;

  6. 类unix系统 递归删除指定文件

    递归删除当前目录下所有以 ._开头的文件 find . -name "._*" | xargs rm -f 或者: find . -name "._*" -ex ...

  7. ***Linux文件夹文件创建、删除、改名

    Linux删除文件夹命令 linux删除目录很简单,很多人还是习惯用rmdir,不过一旦目录非空,就陷入深深的苦恼之中,现在使用rm -rf命令即可.直接rm就可以了,不过要加两个参数-rf 即:rm ...

  8. Linux/Unix mac 命令笔记

    bg和fg Linux/Unix 区别于微软平台最大的优点就是真正的多用户,多任务.因此在任务管理上也有别具特色的管理思想.我们知道,在 Windows 上面,我们要么让一个程序作为服务在后台一直运行 ...

  9. Unix/Linux笔记全集

    1:Unix/Linux操作系统概述 要求:理解应用软件和操作系统的区别,掌握系统的Kernel(核心)和shell(外壳)之间的关系以及各自的作用 Solaris:Solaris 是Sun Micr ...

随机推荐

  1. 【mysql】新方法修改数据库密码以及解决--ERROR 1045 (28000)的问题

    之前 有写过一篇修改mysql数据库的密码的一篇随笔, 地址是:http://www.cnblogs.com/sxdcgaq8080/p/5667124.html 但是此次采用原本的老方法,出现了问题 ...

  2. 你可能从未听过的 Linux 发行版

    Hanthana Linux 官方主页:http://www.hanthana.org Hanthana Linux 基于 Fedora,主要面向 IT 教育,默认包含额外的编/解码器及多媒体播放器. ...

  3. 高级进阶DB2(第2版)

    <高级进阶DB2(第2版)> 基本信息 作者: 牛新庄 出版社:清华大学出版社 ISBN:9787302323839 上架时间:2013-7-3 出版日期:2013 年7月 开本:16开 ...

  4. Oracle错误代码ORA-01653,表空间容量无法扩展

    业务模块在进行增操作时,报错“Caused by: java.sql.BatchUpdateException: ORA-01653: 表 JAZZ_V3.T_MZ_BK 无法通过 128 (在表空间 ...

  5. JAVA常见算法题(二十九)

    package com.forezp.util; import java.util.Scanner; /** * 判断输入的5个字符串的最大长度,并输出 * * * @author Administr ...

  6. phpcms v9自定义HTML文件名

    用过织梦.Wordpress.Zblog等程序的网友都知道,发布内容的时候可以自定义生成的HTML文件名,这个功能对于SEO来说非常有好 处,但是到了V9之后却很遗憾, 这个功能却没有了,现在你只要对 ...

  7. WPF使用ARCGIS App文件配置Cs后台文件

    using System; using System.Collections.Generic; using System.Configuration; using System.Data; using ...

  8. selenium-Getting Started

    1.1. Simple Usage If you have installed Selenium Python bindings, you can start using it from Python ...

  9. spring下载和安装

    下载和安装Spring请按例如以下步骤进行.   (1)登录网站,下载Spring的最新稳定版本号.最新版本号为spring-framework-4.0.建议下载spring-framework-sp ...

  10. Spring Boot(一)启动方式

    1.系统自动生成 SpringApplication.run(XX.class, args); 2.创建SpringApplication对象 SpringApplication app = new ...