<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://infocepo.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Rename-orphans-files.sh</id>
	<title>Rename-orphans-files.sh - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://infocepo.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Rename-orphans-files.sh"/>
	<link rel="alternate" type="text/html" href="https://infocepo.com/wiki/index.php?title=Rename-orphans-files.sh&amp;action=history"/>
	<updated>2026-04-27T04:54:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.13</generator>
	<entry>
		<id>https://infocepo.com/wiki/index.php?title=Rename-orphans-files.sh&amp;diff=746&amp;oldid=prev</id>
		<title>Tcepo: Created page with &quot;&lt;pre&gt; #!/bin/sh  find ./* ./\.[^\.]* ./\.\.?* -type d |while read MyPath ;do   MyCount=$(ls -a1 &quot;$MyPath&quot; |grep -vE &quot;^\.{,2}$&quot; |wc -l)   if [ &quot;${MyCount}&quot; -lt &quot;4&quot; ] ;then...&quot;</title>
		<link rel="alternate" type="text/html" href="https://infocepo.com/wiki/index.php?title=Rename-orphans-files.sh&amp;diff=746&amp;oldid=prev"/>
		<updated>2019-10-29T10:55:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; #!/bin/sh  find ./* ./\.[^\.]* ./\.\.?* -type d |while read MyPath ;do   MyCount=$(ls -a1 &amp;quot;$MyPath&amp;quot; |grep -vE &amp;quot;^\.{,2}$&amp;quot; |wc -l)   if [ &amp;quot;${MyCount}&amp;quot; -lt &amp;quot;4&amp;quot; ] ;then...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
find ./* ./\.[^\.]* ./\.\.?* -type d |while read MyPath ;do&lt;br /&gt;
  MyCount=$(ls -a1 &amp;quot;$MyPath&amp;quot; |grep -vE &amp;quot;^\.{,2}$&amp;quot; |wc -l)&lt;br /&gt;
  if [ &amp;quot;${MyCount}&amp;quot; -lt &amp;quot;4&amp;quot; ] ;then&lt;br /&gt;
    ls -a1 &amp;quot;$MyPath&amp;quot; |grep -vE &amp;quot;^\.{,2}$&amp;quot; |while read MyFile ;do&lt;br /&gt;
      filterMy=$(&lt;br /&gt;
        MyPatern='^(.*)/[^/]*$'&lt;br /&gt;
        echo &amp;quot;$MyPath&amp;quot; |\&lt;br /&gt;
        sed -rn &amp;quot;s#$MyPatern#\1#p&amp;quot; |head -1&lt;br /&gt;
      )&lt;br /&gt;
      MyNewPath=&amp;quot;$filterMy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      filterMy=$(&lt;br /&gt;
        MyPatern='^.*/([^/]*)$'&lt;br /&gt;
        echo &amp;quot;$MyPath&amp;quot; |\&lt;br /&gt;
        sed -rn &amp;quot;s#$MyPatern#\1#p&amp;quot; |head -1&lt;br /&gt;
      )&lt;br /&gt;
      MyDirName=&amp;quot;$filterMy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      mv -vn &amp;quot;${MyPath}/${MyFile}&amp;quot; &amp;quot;${MyNewPath}/${MyDirName}-${MyFile}&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
  fi&lt;br /&gt;
done&lt;br /&gt;
find . -xdev -empty -delete&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tcepo</name></author>
	</entry>
</feed>