LINUX93 shell:sh -c ‘ ‘sh {}+

问题

目录内每行遍历

for file ;do

-sh c

-exec sh -c

bash 复制代码
find [path] [expression] -exec sh -c 'shell commands' sh {} \;
bash 复制代码
find: 遗漏"-exec"的参数
您在 /var/spool/mail/root 中有邮件
[root@web ~]# find /root -type f -exec sh -c '
> for file;do
> if [! -d "$file" ];then
> echo $file
> fi ' sh {} \;
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
bash 复制代码
[root@web ~]# cat fn.sh
find /root -type f -exec sh -c '
for file;do
if [ -d "$file" ];then
echo ""$file" is null"
fi
done
' sh {} \;
[root@web ~]# ./fn.sh
^C您在 /var/spool/mail/root 中有邮件
[root@web ~]#
bash 复制代码
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tm.txt
find $path -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> tm.txt
rm -rf "$file"
fi
done
wc -l tm.txt
' sh {} \;
rm -f tm.txt
[root@web ~]# ./fn.sh
input a path pl:kj
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat kj
cat: kj: 是一个目录
[root@web ~]# ls kj
5.java  file1  file2  file3
[root@web ~]#


bash 复制代码
[root@web ~]# touch 7.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]# echo 777>>7.txt

[root@web ~]# cat 7.txt
[root@web ~]#
bash 复制代码
[root@web ~]# echo 777>>7.txt

[root@web ~]# cat 7.txt
[root@web ~]# echo "7777">>7.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat 7.txt
7777
[root@web ~]# echo 888 >>7.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]# echo $?
0
[root@web ~]# cat 7.txt
7777
888
[root@web ~]#
bash 复制代码
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tm.txt
find "$path" -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> tm.txt
rm -rf "$file"
fi
done
' sh {} +;
wc -l tm.txt
rm -f tm.txt
[root@web ~]# ./f
fn.sh     for51.sh  for5.sh   ftpok.sh  ftp.sh
[root@web ~]# ./fn.sh
input a path pl:kj
0 tm.txt
[root@web ~]# ls kj
5.java  file1  file2  file3


bash 复制代码
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tm.txt
find "$path" -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> /root/tm.txt
rm -rf "$file"
fi
done
' sh {} +;
wc -l <tm.txt
rm -f tm.txt
[root@web ~]# ./fn.sh
input a path pl:kj
0
您在 /var/spool/mail/root 中有邮件
[root@web ~]# ls kj
5.java  file1  file2  file3
[root@web ~]#
bash 复制代码
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tm.txt
find "$path" -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> /root/tm.txt
rm -rf "$file"
fi
done
' sh {} +;
wc -l <tm.txt
rm -f tm.txt
[root@web ~]# ./fn.sh
input a path pl:kj
0
您在 /var/spool/mail/root 中有邮件
[root@web ~]# ls kj
5.java  file1  file2  file3
[root@web ~]# cat 5.txt
cat: 5.txt: 没有那个文件或目录
您在 /var/spool/mail/root 中有邮件

[root@web ~]# ls ~/kj/5.java
[root@web ~]#
bash 复制代码
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tm.txt
find "$path" -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> /root/tm.txt
rm -rf "$file"
fi
done
' sh {} +;
wc -l </root/tm.txt
rm -f tm.txt
[root@web ~]# ./fn.sh
input a path pl:kj
0
您在 /var/spool/mail/root 中有邮件
[root@web ~]# ls ~/kj/5.java
[root@web ~]#

记录

bash 复制代码
root@192.168.235.20's password:
     ┌──────────────────────────────────────────────────────────────
     │                        • MobaXterm 20.0 •
     │            (SSH client, X-server and networking tools)
     │
     │ ➤ SSH session to root@192.168.235.20
     │   • SSH compression : ✘
     │   • SSH-browser     : ✔
     │   • X11-forwarding  : ✔  (remote display is forwarded through
     │   • DISPLAY         : ✔  (automatically set on remote server)
     │
     │ ➤ For more info, ctrl+click on help or visit our website
     └──────────────────────────────────────────────────────────────

Last login: Tue Sep  2 19:16:51 2025 from 192.168.235.1
[root@web ~]# ls
1828.txt                head5                      pas4.txt
1837.txt                head6                      pas5.txt
1.txt                   head7                      pas6.txt
2-1.java                he.txt                     pas7.txt
2.java                  httpd-2.4.37               passwd1.txt
=6                      httpd-2.4.37.tar.bz2       paste1.txt
alll1                   id.sh                      pa.txt
anaconda-ks.cfg         initial-setup-ks.cfg       ph1.txt
app                     inotify-tools-3.13.tar.gz  phonenum.txt
apr-1.5.2               ip.txt                     phon.txt
apr-1.5.2.tar.bz2       judgefn.sh                 pho.sh
apr-util-1.5.4          judgepath.sh               php-7.2.17
apr-util-1.5.4.tar.bz2  judgeprimeok.sh            php-7.2.17.tar.xz
axel-2.4                judgeprime.sh              ping2.sh
axel-2.4.tar.gz         kk                         ping.sh
bb.conf                 lc3.txt                    primeok.sh
cc.conf                 lc4.txt                    process1.sh
classfi.sh              lc5.txt                    process.sh
code                    lc6.txt                    psok.sh
cuser1.sh               lc7.txt                    pub
dir1                    lc.sh                      readme7
dn.sh                   lc.txt                     readme.txt
expect1.sh              lk.txt                     root1.txt
expect4.sh              logs                       rsa.sh
expect5c.sh             luad.txt                   serverOk.sh
expect5.sh              luck.sh                    service-s.sh
expect6.sh              lucky1.txt                 shift.sh
expect.sh               lucky.txt                  Steam.dll
fi1.txt                 luvk.txt                   stuc.sh
file20.java             mysql-5.6.31               sum.sh
file23.java             mysql-5.6.31.tar.gz        system12.txt
for51.sh                normal12.txt               tail
for5.sh                 no.txt                     tail4
ftpok.sh                null                       tail5
ftp.sh                  num.sh                     tail6
head                    ok                         tail7
head2.txt               okl                        tail.txt
head4                   pas3.txt                   ta.txt
您在 /var/spool/mail/root 中有新邮件
[root@web ~]# pwd
/root
[root@web ~]# find /root -type f -exec sh -c '
> for file;do
> if [ -d "$file" ];then
> echo "full"
> else
> echo "$file"
> fi
> '
find: 遗漏"-exec"的参数
您在 /var/spool/mail/root 中有邮件
[root@web ~]# find /root -type f -exec sh -c '
> for file;do
> if [! -d "$file" ];then
> echo $file
> fi ' sh {} \;
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
sh: -c:行5: 语法错误: 未预期的文件结尾
^C
您在 /var/spool/mail/root 中有邮件
[root@web ~]# vim fn.sh
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat fn.sh
find /root -type f -exec sh -c '
for file;do
if [ !-d "$file" ];then
echo ""$file" is null"
fi
done
' sh {} \;
[root@web ~]# chmod +x fn.sh
[root@web ~]# ./fn.sh
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
sh: 第 2 行:[: !-d: 期待一元表达式
^C[root@web ~]# cat fn.sh
find /root -type f -exec sh -c '
for file;do
if [ !-d "$file" ];then
echo ""$file" is null"
fi
done
' sh {} \;
[root@web ~]# vim fn.sh
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat fn.sh
find /root -type f -exec sh -c '
for file;do
if [ -d "$file" ];then
echo ""$file" is null"
fi
done
' sh {} \;
[root@web ~]# ./fn.sh
^C您在 /var/spool/mail/root 中有邮件
[root@web ~]# vim fn.sh
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat fn.sh
find /root -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo ""$file" is null"
fi
done
' sh {} \;
[root@web ~]# ./fn.sh
/root/kk/userc.sh is null
/root/lk.txt is null
/root/=6 is null
/root/file23.java is null
/root/mysql-5.6.31/extra/yassl/AUTHORS is null
/root/mysql-5.6.31/extra/yassl/ChangeLog is null
/root/mysql-5.6.31/extra/yassl/NEWS is null
/root/mysql-5.6.31/libmysql/mysqlclient_depends.c is null
/root/mysql-5.6.31/libmysqld/mysqlserver_depends.c is null
/root/mysql-5.6.31/mysql-test/collections/disabled-daily.list is nul
/root/mysql-5.6.31/mysql-test/collections/disabled-weekly.list is nu
/root/mysql-5.6.31/mysql-test/std_data/bug17532932.MYD is null
/root/mysql-5.6.31/mysql-test/std_data/bug37631.MYD is null
/root/mysql-5.6.31/mysql-test/std_data/cluster_7022_table.MYD is nul
/root/.local/share/tracker/data/.meta.isrunning is null
/root/file20.java is null
/root/httpd-2.4.37/test/.deps is null
/root/httpd-2.4.37/server/mpm/prefork/.deps is null
/root/httpd-2.4.37/server/mpm/.deps is null
/root/httpd-2.4.37/server/.deps is null
/root/httpd-2.4.37/.deps is null
/root/httpd-2.4.37/support/.deps is null
/root/httpd-2.4.37/os/unix/.deps is null
/root/httpd-2.4.37/os/.deps is null
/root/httpd-2.4.37/modules/experimental/.deps is null
/root/httpd-2.4.37/modules/test/.deps is null
/root/httpd-2.4.37/modules/test/mod_dialup.slo is null
/root/httpd-2.4.37/modules/echo/.deps is null
/root/httpd-2.4.37/modules/echo/mod_echo.slo is null
/root/httpd-2.4.37/modules/dav/fs/.deps is null
/root/httpd-2.4.37/modules/dav/fs/mod_dav_fs.slo is null
/root/httpd-2.4.37/modules/dav/fs/dbm.slo is null
/root/httpd-2.4.37/modules/dav/fs/lock.slo is null
/root/httpd-2.4.37/modules/dav/fs/repos.slo is null
/root/httpd-2.4.37/modules/dav/main/.deps is null
/root/httpd-2.4.37/modules/dav/main/mod_dav.slo is null
/root/httpd-2.4.37/modules/dav/main/props.slo is null
/root/httpd-2.4.37/modules/dav/main/util.slo is null
/root/httpd-2.4.37/modules/dav/main/util_lock.slo is null
/root/httpd-2.4.37/modules/dav/main/liveprop.slo is null
/root/httpd-2.4.37/modules/dav/main/providers.slo is null
/root/httpd-2.4.37/modules/dav/main/std_liveprop.slo is null
/root/httpd-2.4.37/modules/dav/lock/.deps is null
/root/httpd-2.4.37/modules/dav/lock/mod_dav_lock.slo is null
/root/httpd-2.4.37/modules/dav/lock/locks.slo is null
/root/httpd-2.4.37/modules/session/.deps is null
/root/httpd-2.4.37/modules/session/mod_session.slo is null
/root/httpd-2.4.37/modules/session/mod_session_cookie.slo is null
/root/httpd-2.4.37/modules/session/mod_session_dbd.slo is null
/root/httpd-2.4.37/modules/filters/.deps is null
/root/httpd-2.4.37/modules/filters/mod_buffer.slo is null
/root/httpd-2.4.37/modules/filters/mod_data.slo is null
/root/httpd-2.4.37/modules/filters/mod_ratelimit.slo is null
/root/httpd-2.4.37/modules/filters/mod_reqtimeout.slo is null
/root/httpd-2.4.37/modules/filters/mod_ext_filter.slo is null
/root/httpd-2.4.37/modules/filters/mod_filter.slo is null
/root/httpd-2.4.37/modules/filters/mod_request.slo is null
/root/httpd-2.4.37/modules/filters/mod_include.slo is null
/root/httpd-2.4.37/modules/filters/mod_reflector.slo is null
/root/httpd-2.4.37/modules/filters/mod_substitute.slo is null
/root/httpd-2.4.37/modules/filters/mod_sed.slo is null
/root/httpd-2.4.37/modules/filters/sed0.slo is null
/root/httpd-2.4.37/modules/filters/sed1.slo is null
/root/httpd-2.4.37/modules/filters/regexp.slo is null
/root/httpd-2.4.37/modules/filters/mod_charset_lite.slo is null
/root/httpd-2.4.37/modules/filters/mod_deflate.slo is null
/root/httpd-2.4.37/modules/mappers/.deps is null
/root/httpd-2.4.37/modules/mappers/mod_vhost_alias.slo is null
/root/httpd-2.4.37/modules/mappers/mod_negotiation.slo is null
/root/httpd-2.4.37/modules/mappers/mod_dir.slo is null
/root/httpd-2.4.37/modules/mappers/mod_actions.slo is null
/root/httpd-2.4.37/modules/mappers/mod_speling.slo is null
/root/httpd-2.4.37/modules/mappers/mod_userdir.slo is null
/root/httpd-2.4.37/modules/mappers/mod_alias.slo is null
/root/httpd-2.4.37/modules/mappers/mod_rewrite.slo is null
/root/httpd-2.4.37/modules/metadata/.deps is null
/root/httpd-2.4.37/modules/metadata/mod_env.slo is null
/root/httpd-2.4.37/modules/metadata/mod_setenvif.slo is null
/root/httpd-2.4.37/modules/metadata/mod_mime_magic.slo is null
/root/httpd-2.4.37/modules/metadata/mod_expires.slo is null
/root/httpd-2.4.37/modules/metadata/mod_headers.slo is null
/root/httpd-2.4.37/modules/metadata/mod_usertrack.slo is null
/root/httpd-2.4.37/modules/metadata/mod_unique_id.slo is null
/root/httpd-2.4.37/modules/metadata/mod_version.slo is null
/root/httpd-2.4.37/modules/metadata/mod_remoteip.slo is null
/root/httpd-2.4.37/modules/database/.deps is null
/root/httpd-2.4.37/modules/database/mod_dbd.slo is null
/root/httpd-2.4.37/modules/aaa/.deps is null
/root/httpd-2.4.37/modules/aaa/mod_authn_file.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authn_dbm.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authn_anon.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authn_dbd.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authn_socache.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authn_core.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authz_host.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authz_groupfile.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authz_user.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authz_dbm.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authz_owner.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authz_dbd.slo is null
/root/httpd-2.4.37/modules/aaa/mod_authz_core.slo is null
/root/httpd-2.4.37/modules/aaa/mod_access_compat.slo is null
/root/httpd-2.4.37/modules/aaa/mod_auth_basic.slo is null
/root/httpd-2.4.37/modules/aaa/mod_auth_form.slo is null
/root/httpd-2.4.37/modules/aaa/mod_auth_digest.slo is null
/root/httpd-2.4.37/modules/aaa/mod_allowmethods.slo is null
/root/httpd-2.4.37/modules/debugging/.deps is null
/root/httpd-2.4.37/modules/debugging/mod_dumpio.slo is null
/root/httpd-2.4.37/modules/ldap/.deps is null
/root/httpd-2.4.37/modules/http/.deps is null
/root/httpd-2.4.37/modules/http/mod_mime.slo is null
/root/httpd-2.4.37/modules/slotmem/.deps is null
/root/httpd-2.4.37/modules/slotmem/mod_slotmem_shm.slo is null
/root/httpd-2.4.37/modules/slotmem/mod_slotmem_plain.slo is null
/root/httpd-2.4.37/modules/arch/unix/.deps is null
/root/httpd-2.4.37/modules/arch/unix/mod_unixd.slo is null
/root/httpd-2.4.37/modules/arch/win32/.deps is null
/root/httpd-2.4.37/modules/http2/.deps is null
/root/httpd-2.4.37/modules/cache/.deps is null
/root/httpd-2.4.37/modules/cache/mod_file_cache.slo is null
/root/httpd-2.4.37/modules/cache/mod_cache.slo is null
/root/httpd-2.4.37/modules/cache/cache_storage.slo is null
/root/httpd-2.4.37/modules/cache/cache_util.slo is null
/root/httpd-2.4.37/modules/cache/mod_cache_disk.slo is null
/root/httpd-2.4.37/modules/cache/mod_cache_socache.slo is null
/root/httpd-2.4.37/modules/cache/mod_socache_shmcb.slo is null
/root/httpd-2.4.37/modules/cache/mod_socache_dbm.slo is null
/root/httpd-2.4.37/modules/cache/mod_socache_memcache.slo is null
/root/httpd-2.4.37/modules/loggers/.deps is null
/root/httpd-2.4.37/modules/loggers/mod_log_config.slo is null
/root/httpd-2.4.37/modules/loggers/mod_log_debug.slo is null
/root/httpd-2.4.37/modules/loggers/mod_log_forensic.slo is null
/root/httpd-2.4.37/modules/loggers/mod_logio.slo is null
/root/httpd-2.4.37/modules/lua/.deps is null
/root/httpd-2.4.37/modules/generators/.deps is null
/root/httpd-2.4.37/modules/generators/mod_status.slo is null
/root/httpd-2.4.37/modules/generators/mod_autoindex.slo is null
/root/httpd-2.4.37/modules/generators/mod_asis.slo is null
/root/httpd-2.4.37/modules/generators/mod_info.slo is null
/root/httpd-2.4.37/modules/generators/mod_cgi.slo is null
/root/httpd-2.4.37/modules/md/.deps is null
/root/httpd-2.4.37/modules/cluster/.deps is null
/root/httpd-2.4.37/modules/cluster/mod_heartbeat.slo is null
/root/httpd-2.4.37/modules/cluster/mod_heartmonitor.slo is null
/root/httpd-2.4.37/modules/examples/.deps is null
/root/httpd-2.4.37/modules/proxy/balancers/.deps is null
/root/httpd-2.4.37/modules/proxy/balancers/mod_lbmethod_byrequests.s
/root/httpd-2.4.37/modules/proxy/balancers/mod_lbmethod_bytraffic.sl
/root/httpd-2.4.37/modules/proxy/balancers/mod_lbmethod_bybusyness.s
/root/httpd-2.4.37/modules/proxy/balancers/mod_lbmethod_heartbeat.sl
/root/httpd-2.4.37/modules/proxy/.deps is null
/root/httpd-2.4.37/modules/proxy/mod_proxy.slo is null
/root/httpd-2.4.37/modules/proxy/proxy_util.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_connect.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_ftp.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_http.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_fcgi.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_scgi.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_ajp.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_uwsgi.slo is null
/root/httpd-2.4.37/modules/proxy/ajp_header.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_fdpass.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_wstunnel.slo is null
/root/httpd-2.4.37/modules/proxy/ajp_link.slo is null
/root/httpd-2.4.37/modules/proxy/ajp_msg.slo is null
/root/httpd-2.4.37/modules/proxy/ajp_utils.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_balancer.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_express.slo is null
/root/httpd-2.4.37/modules/proxy/mod_proxy_hcheck.slo is null
/root/httpd-2.4.37/modules/ssl/.deps is null
/root/httpd-2.4.37/modules/ssl/mod_ssl.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_config.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_init.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_io.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_kernel.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_log.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_mutex.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_pphrase.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_rand.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_vars.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_scache.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_util_stapling.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_util.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_util_ssl.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_engine_ocsp.slo is null
/root/httpd-2.4.37/modules/ssl/ssl_util_ocsp.slo is null
/root/httpd-2.4.37/modules/core/.deps is null
/root/httpd-2.4.37/modules/core/mod_watchdog.slo is null
/root/httpd-2.4.37/modules/core/mod_macro.slo is null
/root/httpd-2.4.37/modules/.deps is null
/root/httpd-2.4.37/srclib/.deps is null
/root/php-7.2.17/sapi/cgi/php.sym is null
/root/php-7.2.17/mkinstalldirs is null
/root/php-7.2.17/install-sh is null
/root/php-7.2.17/missing is null
/root/php-7.2.17/ext/standard/tests/image/blank_file.bmp is null
/root/php-7.2.17/ext/dom/tests/empty.html is null
/root/php-7.2.17/ext/fileinfo/EXPERIMENTAL is null
/root/php-7.2.17/ext/mbstring/oniguruma/NEWS is null
/root/php-7.2.17/ext/mbstring/oniguruma/ChangeLog is null
/root/php-7.2.17/ext/pdo_odbc/EXPERIMENTAL is null
/root/php-7.2.17/ext/phar/tests/bug53872/second.txt is null
/root/php-7.2.17/ext/phar/tests/bug54289/in/dirAB/file2 is null
/root/php-7.2.17/ext/phar/tests/bug54289/in/dirAB/file3 is null
/root/php-7.2.17/ext/phar/tests/bug54289/in/dirAB/file1 is null
/root/php-7.2.17/ext/phar/tests/bug54289/in/dirA/fileB is null
/root/php-7.2.17/ext/phar/tests/bug54289/in/dirA/fileA is null
/root/php-7.2.17/ext/skeleton/EXPERIMENTAL is null
/root/app/java/4.java is null
/root/app/java/5.java is null
/root/app/java/7.java is null
/root/app/java/file6.java is null
/root/app/java/file7.java is null
/root/app/java/file8.java is null
/root/app/java/file9.java is null
/root/app/java/file10.java is null
/root/app/java/file11.java is null
/root/app/java/file12.java is null
/root/app/1.java is null
/root/app/2.java is null
/root/app/3.java is null
/root/app/4.java is null
/root/2.java is null
/root/2-1.java is null
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat /root/app/2.java
[root@web ~]# cat fn.sh
find /root -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo ""$file" is null"
fi
done
' sh {} \;
[root@web ~]# vim fn.sh
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
mkdir tmp
find $path -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> tmp
rm -rf "$file"
fi
done
wc -l tmp
' sh {} \;
rm -f rmp
[root@web ~]# ./fn.sh
input a path pl:^C
find: '\003': 没有那个文件或目录
[root@web ~]# midir -p ~/kj/5.java
bash: midir: 未找到命令...
您在 /var/spool/mail/root 中有邮件
[root@web ~]# mkdir -p ~/kj/5.java
[root@web ~]# cd kj
[root@web kj]# ls
5.java
[root@web kj]# touch file{78..98}.java
您在 /var/spool/mail/root 中有邮件
[root@web kj]# ls
5.java       file81.java  file85.java  file89.java  file93.java  fil
file78.java  file82.java  file86.java  file90.java  file94.java  fil
file79.java  file83.java  file87.java  file91.java  file95.java
file80.java  file84.java  file88.java  file92.java  file96.java
[root@web kj]# cd ~
[root@web ~]# ./fn.sh
input a path pl:kj
mkdir: 无法创建目录"tmp": 文件已存在
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
sh:行3: tmp: 是一个目录
wc: tmp: 是一个目录
0 tmp
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
mkdir tmp
find $path -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> tmp
rm -rf "$file"
fi
done
wc -l tmp
' sh {} \;
rm -f rmp
[root@web ~]# vim fn.sh
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tmp.txt
find $path -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> tmp
rm -rf "$file"
fi
done
wc -l tmp.txt
' sh {} \;
rm -f tmp.txt
[root@web ~]# ./fn.sh
input a path pl:kj
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cd kj
[root@web kj]# ls
5.java
[root@web kj]# touch file{33..46}.txt
[root@web kj]# ls
5.java      file34.txt  file36.txt  file38.txt  file40.txt  file42.t
file33.txt  file35.txt  file37.txt  file39.txt  file41.txt  file43.t
[root@web kj]# mkdir file{1..3}
[root@web kj]# ls
5.java  file2  file33.txt  file35.txt  file37.txt  file39.txt  file4
file1   file3  file34.txt  file36.txt  file38.txt  file40.txt  file4
[root@web kj]# ./fn.sh
-bash: ./fn.sh: 没有那个文件或目录
您在 /var/spool/mail/root 中有邮件
[root@web kj]# cd ~
[root@web ~]# ls
1828.txt                head5                      pas4.txt
1837.txt                head6                      pas5.txt
1.txt                   head7                      pas6.txt
2-1.java                he.txt                     pas7.txt
2.java                  httpd-2.4.37               passwd1.txt
=6                      httpd-2.4.37.tar.bz2       paste1.txt
alll1                   id.sh                      pa.txt
anaconda-ks.cfg         initial-setup-ks.cfg       ph1.txt
app                     inotify-tools-3.13.tar.gz  phonenum.txt
apr-1.5.2               ip.txt                     phon.txt
apr-1.5.2.tar.bz2       judgefn.sh                 pho.sh
apr-util-1.5.4          judgepath.sh               php-7.2.17
apr-util-1.5.4.tar.bz2  judgeprimeok.sh            php-7.2.17.tar.xz
axel-2.4                judgeprime.sh              ping2.sh
axel-2.4.tar.gz         kj                         ping.sh
bb.conf                 kk                         primeok.sh
cc.conf                 lc3.txt                    process1.sh
classfi.sh              lc4.txt                    process.sh
code                    lc5.txt                    psok.sh
cuser1.sh               lc6.txt                    pub
dir1                    lc7.txt                    readme7
dn.sh                   lc.sh                      readme.txt
expect1.sh              lc.txt                     root1.txt
expect4.sh              lk.txt                     rsa.sh
expect5c.sh             logs                       serverOk.sh
expect5.sh              luad.txt                   service-s.sh
expect6.sh              luck.sh                    shift.sh
expect.sh               lucky1.txt                 Steam.dll
fi1.txt                 lucky.txt                  stuc.sh
file20.java             luvk.txt                   sum.sh
file23.java             mysql-5.6.31               system12.txt
fn.sh                   mysql-5.6.31.tar.gz        tail
for51.sh                normal12.txt               tail4
for5.sh                 no.txt                     tail5
ftpok.sh                null                       tail6
ftp.sh                  num.sh                     tail7
head                    ok                         tail.txt
head2.txt               okl                        ta.txt
head4                   pas3.txt                   test1.sh
[root@web ~]# ./fn.sh
input a path pl:kj
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
sh:行3: tmp: 是一个目录
0 tmp.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]# ls /tmp
ssh-P2BniBI6vppt
swapfile
sys-20250821.tar.gz
sys-20250822.tar.gz
sys-20250823.tar.gz
sys-20250824.tar.gz
sys-20250825.tar.gz
sys-20250828.tar.gz
sys-20250831.tar.gz
sys-20250901.tar.gz
sys-20250902.tar.gz
sys-20250903.tar.gz
sys-20250904.tar.gz
systemd-private-473c444f08ae4d4681e8e22d6d2b8b30-bolt.service-MXuAzE
systemd-private-473c444f08ae4d4681e8e22d6d2b8b30-chronyd.service-LWJ
systemd-private-473c444f08ae4d4681e8e22d6d2b8b30-colord.service-fxsn
systemd-private-473c444f08ae4d4681e8e22d6d2b8b30-cups.service-T6hgjr
systemd-private-473c444f08ae4d4681e8e22d6d2b8b30-rtkit-daemon.servic
systemd-private-c3616077dead4a728f788c2e68c48cc1-bolt.service-12dTMj
systemd-private-c3616077dead4a728f788c2e68c48cc1-chronyd.service-nYw
systemd-private-c3616077dead4a728f788c2e68c48cc1-colord.service-nIV9
systemd-private-c3616077dead4a728f788c2e68c48cc1-cups.service-Grtyz3
systemd-private-c3616077dead4a728f788c2e68c48cc1-fwupd.service-9cCdQ
systemd-private-c3616077dead4a728f788c2e68c48cc1-rtkit-daemon.servic
tracker-extract-files.1000
vmware-root_1336-2957190235
vmware-root_1338-2965513689
[root@web ~]# ls kj
5.java  file1  file2  file3
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tmp.txt
find $path -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> tmp
rm -rf "$file"
fi
done
wc -l tmp.txt
' sh {} \;
rm -f tmp.txt
[root@web ~]# vim fn.sh
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tm.txt
find $path -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> tm.txt
rm -rf "$file"
fi
done
wc -l tm.txt
' sh {} \;
rm -f tm.txt
[root@web ~]# ./fn.sh
input a path pl:kj
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat kj
cat: kj: 是一个目录
[root@web ~]# ls kj
5.java  file1  file2  file3
[root@web ~]# vim fn.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]# vim fn.sh
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat f
fi1.txt      file23.java  fn.txt       for5.sh      ftp.sh
file20.java  fn.sh        for51.sh     ftpok.sh
[root@web ~]# cat fn.sh
read -p "input a path pl:" path
touch tm.txt
find "$path" -type f -exec sh -c '
for file;do
if [ ! -s "$file" ];then
echo 1 >> tm.txt
rm -rf "$file"
fi
done
' sh {} +;
wc -l tm.txt
rm -f tm.txt
[root@web ~]# ./f
fn.sh     for51.sh  for5.sh   ftpok.sh  ftp.sh
[root@web ~]# ./fn.sh
input a path pl:kj
0 tm.txt
[root@web ~]# ls kj
5.java  file1  file2  file3
[root@web ~]# touch 7.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]# echo 777>>7.txt

[root@web ~]# cat 7.txt
[root@web ~]# echo "7777">>7.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]# cat 7.txt
7777
[root@web ~]# echo 888 >>7.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]# echo $?
0
[root@web ~]# cat 7.txt
7777
888
[root@web ~]# wc -l 7.txt
2 7.txt
您在 /var/spool/mail/root 中有邮件
[root@web ~]#
相关推荐
误入运维泥潭2 天前
Shell脚本入门:从零到精通
shell·字符串处理·case语句
czhc11400756632 天前
Linux92 shell:倒计时,用户分类
shell
从零开始的ops生活2 天前
【Day 42】Shell-expect和sed
linux·运维·ssh·shell·expect
Johny_Zhao2 天前
达梦数据库高可用集群部署方案
linux·mysql·网络安全·docker·信息安全·kubernetes·云计算·shell·containerd·达梦数据库·yum源·系统运维·centos8
挖稀泥的工人3 天前
如何在Eletron中打开window的powershell
前端·electron·shell
sunny052968 天前
Linux shell getopts 解析命令行参数
linux·运维·bash·shell
Johny_Zhao9 天前
Conda、Anaconda、Miniconda对比分析
linux·网络安全·信息安全·kubernetes·云计算·conda·shell·containerd·anaconda·yum源·系统运维·miniconda
G_H_S_3_11 天前
【网络运维】Shell 脚本编程:while 循环与 until 循环
linux·运维·网络·shell
coderklaus11 天前
Shell 基础知识
linux·macos·shell