检查目录下 文件的权限-linux shell脚本
#!/bin/bash
#History:
#2019/07/23 Fsq
#This Program will check Permissions on dir
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
read -p "please input your dir:" dir
if [ "$dir" == "" -o ! -d "$dir" ];then #检查目录是否存在
echo "This $dir is not exsit in system"
exit 1
fi
filelist=$(ls $dir) #列出该目录下的所有文件名
for filename in $filelist
do
perm=""
test -r "$dir/$filelist" && perm="$perm readable"
test -w "$dir/$filelist" && perm="$perm writable"
test -x "$dir/$filename" && perm="$perm executable"
echo "The file $dir/$filename's permission is $perm"
done
检查目录下 文件的权限-linux shell脚本的更多相关文章
- linux下为目录和文件设置权限
摘:linux下为目录和文件设置权限 分类: Linux2012-05-09 03:18 7456人阅读 评论(1) 收藏 举报 linuxwordpressweb数据库serverfile linu ...
- Linux常用基础命令整理:关机命令、查看目录下文件命令等
Linux常用基础命令整理:关机命令.查看目录下文件命令等 整理了一些Linux常用基础命令,欢迎指正. 首先记住四个热键,学会这四个键,收益一辈子. Tab按键---命令补齐功能Ctrl+c按键-- ...
- Linux中/proc目录下文件详解
转载于:http://blog.chinaunix.net/uid-10449864-id-2956854.html Linux中/proc目录下文件详解(一)/proc文件系统下的多种文件提供的系统 ...
- Linux目录与文件的权限
零.Linux中的权限为什么重要? 权限直接关系数据安全! 一.用户基础概念: 所有者(owner):拥有这个文件的用户.一般拥有目录或文件的所有权限. 用户组(group):几个用户组成一个用户组, ...
- 位于/var/log目录下的20个Linux日志文件
位于/var/log目录下的20个Linux日志文件[译] from:http://buptguo.com/2014/01/16/linux-var-log-files/ 原文地址:20 Linux ...
- Linux中/proc目录下文件详解(转贴)
转载:http://www.sudu.cn/info/index.php?op=article&id=302529 Linux中/proc目录下文件详解(一) 声明:可以自由转载本文, ...
- shell脚本 批量转换目录下文件编码
发布:JB01 来源:脚本学堂 [大 中 小] 分享一例shell脚本,实现可以批量转换目录下的文件编码,很实用的一个小shell,有需要的朋友参考下.原文地址:http://www.jb ...
- linux 目录下文件批量植入和删除,按日期打包
linux目录下文件批量植入 [root@greymouster http2]# find /usr/local/http2/htdocs/ -type f|xargs sed -i " ...
- shell脚本监控目录下文件被篡改时报警
思路: 目录下文件被篡改的几种可能: 1.被修改 2.被删除 3.新增文件 md5命令详解 参数: -b 以二进制模式读入文件内容 -t 以文本模式读入文件内容 -c 根据已生成的md5值,对现存文件 ...
随机推荐
- 初识PHP变量函数语法
PHP连接字符串 . <?php '你好,'.'我的亲爱的老师'?> PHP语句结束符 <?php echo "欢迎同学们!"; echo "Welco ...
- Codeforces 1203F (贪心, DP)
题意:有n个任务,你的初始rating是m, 这n个任务有两个指标:完成这项任务所需的最低rating(a[i]),以及完成这项任务后rating的变化(可能为负)(b[i]).rating不能为负. ...
- eclipse远程调试Tomcat方法(转)
转自:http://blog.csdn.net/afgasdg/article/details/9236877 1.Linux中配置tomcat在catalina.sh中添加如下CATALINA_OP ...
- python请求基本库使用
高级用法 http://cn.python-requests.org/zh_CN/latest/user/quickstart.html#url 3.2 requests 源码 def request ...
- tensorflow报错
libcublas.so.9.0: cannot open shared object file: No such file or directory 输入命令: sudo ldconfig/usr/ ...
- Java8使用实现Runnable接口方式创建新线程的方法
环境介绍 JDK版本:1.8 开发架构:spring boot 2.x 日志:slf4j 实现步骤 Runnable接口中只有一个run()方法,它是非Thread类子类的类提供的一种激活方式.一个类 ...
- 【leetcode】424. Longest Repeating Character Replacement
题目如下: Given a string that consists of only uppercase English letters, you can replace any letter in ...
- PHP CURL或file_get_contents获取网页标题的代码及两者效率的稳定性问题
PHP CURL与file_get_contents函数都可以获取远程服务器上的文件保存到本地,但在性能上面两者完全不在同一个级别,下面我先来介绍PHP CURL或file_get_contents函 ...
- 为什么NULL能多次free
void __cdecl _free_base (void * pBlock) { int retval = 0; if (pBlock == NULL) ...
- How do I force my .NET application to run as administrator?
How do I force my .NET application to run as administrator? You'll want to modify the manifest that ...