<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
		<id>https://wiki.nonip.net/index.php?action=history&amp;feed=atom&amp;title=Linux%2F%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A1%E3%83%A2%2Frm</id>
		<title>Linux/コマンドメモ/rm - 変更履歴</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.nonip.net/index.php?action=history&amp;feed=atom&amp;title=Linux%2F%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A1%E3%83%A2%2Frm"/>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Linux/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A1%E3%83%A2/rm&amp;action=history"/>
		<updated>2026-04-18T08:38:03Z</updated>
		<subtitle>このウィキのこのページに関する変更履歴</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>https://wiki.nonip.net/index.php?title=Linux/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A1%E3%83%A2/rm&amp;diff=1214&amp;oldid=prev</id>
		<title>2015年6月9日 (火) 15:55にAdminによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Linux/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A1%E3%83%A2/rm&amp;diff=1214&amp;oldid=prev"/>
				<updated>2015-06-09T15:55:17Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←前の版&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2015年6月9日 (火) 15:55時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;行26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;行26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==ファイル削除==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==ファイル削除==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; find /tmp/log -type f -exec rm {} \;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; find /tmp/log -type f -exec rm {} \;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==大量ファイル削除時( /bin/rm: 引数リストが長すぎます)エラー対処法==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; echo /tmp/*.log | xargs rm&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;参考：http://blog.mizoshiri.com/archives/150&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>https://wiki.nonip.net/index.php?title=Linux/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A1%E3%83%A2/rm&amp;diff=864&amp;oldid=prev</id>
		<title>127.0.0.1: ページの作成:「==サブも含めてディレクトリごと削除==  rm -fr /var/.backup/tmp_export2/  ==30日以上たったログファイルを削除==  find /tmp/log -name '*.log' -...」</title>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Linux/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A1%E3%83%A2/rm&amp;diff=864&amp;oldid=prev"/>
				<updated>2015-05-19T18:18:20Z</updated>
		
		<summary type="html">&lt;p&gt;ページの作成:「==サブも含めてディレクトリごと削除==  rm -fr /var/.backup/tmp_export2/  ==30日以上たったログファイルを削除==  find /tmp/log -name &amp;#039;*.log&amp;#039; -...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==サブも含めてディレクトリごと削除==&lt;br /&gt;
 rm -fr /var/.backup/tmp_export2/&lt;br /&gt;
&lt;br /&gt;
==30日以上たったログファイルを削除==&lt;br /&gt;
 find /tmp/log -name '*.log' -mtime '+30' -exec rm -f {} \;&lt;br /&gt;
&lt;br /&gt;
こちらのほうが高速？&lt;br /&gt;
 find /tmp/log -name '*.log' -type f -mtime '+30' -print | xargs rm&lt;br /&gt;
&lt;br /&gt;
==引数に付けたdirpath内の30日以上たったログファイルを削除==&lt;br /&gt;
 sh rmlog.sh var/log1 var/log2&lt;br /&gt;
&lt;br /&gt;
*rmlog.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 for dirpath in $@&lt;br /&gt;
 do&lt;br /&gt;
   if expr &amp;quot;$dirpath&amp;quot; : &amp;quot;[A-z0-9][A-z0-9_-]*$&amp;quot; &amp;gt; /dev/null; then&lt;br /&gt;
 #  if [[ &amp;quot;$dirpath&amp;quot; =~ ^[A-z0-9][_A-z0-9_-]*$ ]]; then&lt;br /&gt;
     if [ -e $dirpath ]; then&lt;br /&gt;
       find $dirpath -name '*.*' -type f -mtime '+30' | xargs --no-run-if-empty rm -v&lt;br /&gt;
     fi&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;error dirpath=$dirpath&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
 done&lt;br /&gt;
==ファイル削除==&lt;br /&gt;
 find /tmp/log -type f -exec rm {} \;&lt;/div&gt;</summary>
		<author><name>127.0.0.1</name></author>	</entry>

	</feed>