zoukankan      html  css  js  c++  java
  • Unix删除当前目录可执行文件

    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 {} ;

  • 相关阅读:
    bzoj1103[POI2007]大都市meg
    bzoj1098[POI2007]办公楼biu
    bzoj1102[POI2007]山峰和山谷Grz
    POI刷题记录
    语法-指针
    dp-最长公共子序列
    如何判断素数
    C++的map用法
    stl-优先队列
    C++和Java的stack语法
  • 原文地址:https://www.cnblogs.com/wucg/p/4053868.html
Copyright © 2011-2022 走看看