<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel rdf:about="https://dwt.life/feed/rss/tag/shell/">
<title>dwt&#039;s life - shell</title>
<link>https://dwt.life/tag/shell/</link>
<description></description>
<items>
<rdf:Seq>
<rdf:li resource="https://dwt.life/archives/145/"/>
<rdf:li resource="https://dwt.life/archives/98/"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="https://dwt.life/archives/145/">
<title>liunx下选择文件大小为0的文件（find)</title>
<link>https://dwt.life/archives/145/</link>
<dc:date>2021-11-20T20:35:20+08:00</dc:date>
<description>查找当前路径下所有文件大小为0的文件，并输出这些文件的名字find . -name &quot;*&quot; -type f -size 0c &gt; out.txt
#find . -name 之间有空格 修改对应的 -size 参数就可以查找指定大小的文件，如1k大小的文件（注意不要用 -size 1k，这个得到的是占用空间1k，不是文件大小1k的）find . -name &quot;*&quot; -type f -size 1024c删除指定的文件find . -name &quot;*&quot; -type f -size 0c | xargs -n 1 rm -f查询出所有的空文件夹find -type d -empty查找指定的文件名find . -name &quot;name.txt&quot;</description>
</item>
<item rdf:about="https://dwt.life/archives/98/">
<title>Linux下Shell的for循环语句</title>
<link>https://dwt.life/archives/98/</link>
<dc:date>2021-08-06T11:28:00+08:00</dc:date>
<description>第一类：数字性循环for1-1.sh#!/bin/bash  
  
for((i=1;i&lt;=10;i++));  
do   
echo $(expr $i \* 3 + 1);  
done  for1-2.sh#!/bin/bash  
  
for i in $(seq 1 10)  
do   
echo $(expr $i \* 3 + 1);  
done   for1-3.sh#!/bin/bash  
  
for i in {1..10}  
do  
echo $(expr $i \* 3 + 1);  
done  for1-4.sh#!/bin/bash  
  
awk &#039;BEGIN{for(i=1; i&lt;=10; i++) print i}&#039;  第二类：字符性循环for2-1.sh#!/bin/bash  
  
for i in `ls`;  
do   
echo $i is file name\! ;  
done   for2-2.sh#!/bin/bash  
  
for i in $* ;  
do  
echo $i is input chart\! ;  
done  for2-3.sh#!/bin/bash  
  
for i in f1 f2 f3 ;  
do  
echo $i is appoint ;  
done  for2-4.sh#!/bin/bash  
  
list=&quot;rootfs usr data data2&quot;  
for i in $list;  
do  
echo $i is appoint ;  
done  第三类：路径查找for3-1.sh#!/bin/bash  
  
for file in /proc/*;  
do  
echo $file is file path \! ;  
done  for3-2.sh#!/bin/bash  
  
for file in $(ls *.sh)  
do  
echo $file is file path \! ;  
done  总结：现在一般都使用for in结构，for in结构后面可以使用函数来构造范围，比如$()、``这些，里面写一些查找的语法，比如ls test*，那么遍历之后就是输出文件名了。参考：http://blog.csdn.net/babyfish13/article/details/52981110</description>
</item>
</rdf:RDF>