<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Что можно придумать для сортировки 50 000 файлов по 1000 штук в папки?]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=34510&amp;type=atom" />
	<updated>2014-04-09T19:47:50Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=34510</id>
		<entry>
			<title type="html"><![CDATA[Re: Что можно придумать для сортировки 50 000 файлов по 1000 штук в папки?]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=404230#p404230" />
			<content type="html"><![CDATA[<p>Вот впрочем нашел пример такой </p><div class="codebox"><pre><code>#!/bin/bash
dest_base=&quot;./dest&quot;
src_dir=&quot;./src&quot;

atfile=0
atdir=0
for file in $src_dir/*; do
    if ((atfile == 0)); then
        dest_dir=$(printf &quot;$dest_base/%0.5d&quot; $atdir)
        [[ -d $dest_dir ]] || mkdir -p $dest_dir
    fi
    mv $file $dest_dir
    ((atfile++))
    if ((atfile &gt; 1000)); then # 1000 количество файлов.
        atfile=0
        ((atdir++))
    fi
done</code></pre></div>]]></content>
			<author>
				<name><![CDATA[EvgeniusDragon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=20502</uri>
			</author>
			<updated>2014-04-09T19:47:50Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=404230#p404230</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Что можно придумать для сортировки 50 000 файлов по 1000 штук в папки?]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=404226#p404226" />
			<content type="html"><![CDATA[<p>Просто нужно переместить в папки названия типа <br />1<br />2<br />3<br />...</p><p>по 1000 файлов (в моем случаи jpg) из директории где у меня 50 000 файлов</p>]]></content>
			<author>
				<name><![CDATA[EvgeniusDragon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=20502</uri>
			</author>
			<updated>2014-04-09T19:00:36Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=404226#p404226</id>
		</entry>
</feed>
