<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shell script Archives - ITEC4B</title>
	<atom:link href="https://itec4b.com/tag/shell-script/feed/" rel="self" type="application/rss+xml" />
	<link>https://itec4b.com/tag/shell-script/</link>
	<description>Information Technology Expert Consulting</description>
	<lastBuildDate>Thu, 23 Feb 2023 10:17:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
	<item>
		<title>Debian: List/Check Installed Packages</title>
		<link>https://itec4b.com/debian-list-check-installed-packages/</link>
		
		<dc:creator><![CDATA[author]]></dc:creator>
		<pubDate>Wed, 01 Feb 2023 16:43:02 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[shell script]]></category>
		<guid isPermaLink="false">https://itec4b.com/?p=916</guid>

					<description><![CDATA[List All Installed Packages Look For Specific Package(s)]]></description>
										<content:encoded><![CDATA[
<h3>List All Installed Packages</h3>



<pre class="wp-block-code"><code>$ LC_ALL=C dpkg-query -f '${Package} ${Version} ${Status}\n' -W | awk '{print $1" "$2" "$4" "$5}' | column -t</code></pre>



<h3>Look For Specific Package(s)</h3>



<pre class="wp-block-code"><code>Multiple package names and glob patterns works

$ LC_ALL=C dpkg-query -f '${Package} ${Version} ${Status}\n' -W &lt;pkg_name&gt; | awk '{print $1" "$2" "$4" "$5}' | column -t</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Debian Shell: List Files</title>
		<link>https://itec4b.com/debian-shell-list-files/</link>
		
		<dc:creator><![CDATA[author]]></dc:creator>
		<pubDate>Thu, 26 Jan 2023 20:29:25 +0000</pubDate>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>
		<guid isPermaLink="false">https://itec4b.com/?p=365</guid>

					<description><![CDATA[IMPORTANT: You should NOT use empty spaces within files or directories names You can use a program to rename directories and files without empty spaces Recursive List/Delete Empty Directories List/Delete Empty Files List Top 100 biggest files from DIR Get directory size (content) List (sub)directories size + mtime from DIR, sort by size List (sub)directories &#8230; <p class="link-more"><a href="https://itec4b.com/debian-shell-list-files/" class="more-link">Read more<span class="screen-reader-text"> "Debian Shell: List Files"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p class="has-vivid-red-color has-text-color"><strong><span style="text-decoration: underline;">IMPORTANT</span>: You should NOT use empty spaces within files or directories names</strong></p>



<p>You can use a <a href="https://github.com/ITEC4B/rename-dir-files">program to rename directories and files</a> without empty spaces</p>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">List size files from DIR</span></strong>
<strong>OUTPUT: &lt;logical_size_bytes&gt; &lt;physical_size_bytes&gt; &lt;filepath&gt;</strong>

$ LC_ALL=C find DIR -type f -exec stat -c '%s %b %B %n' {} + 2&gt;/dev/null | awk '{ fname=""; for (i=4; i &lt;= NF; i++) fname=fname $i " "; print $1" "($2*$3)" "fname }'


<strong><span style="text-decoration: underline;">List files from DIR with physical size &gt;= nMB</span></strong>
<strong>OUTPUT: &lt;logical_size_bytes&gt; &lt;physical_size_bytes&gt; &lt;filepath&gt;</strong>

$ LC_ALL=C find DIR -type f -exec stat -c '%s %b %B %n' {} + 2&gt;/dev/null | awk '{ fname=""; for (i=4; i &lt;= NF; i++) fname=fname $i " "; print $1" "($2*$3)" "fname }' | awk '$2&gt;=nMB*(1024^2) {print $0}'</code></pre>



<pre class="wp-block-code has-black-color has-text-color"><code><strong><span style="text-decoration: underline;">List <strong>ALL files from</strong> DIR, No Sort, date (mtime)</span></strong>
<strong>STD_CMD_LS_ALL</strong>
<strong>OUTPUT:</strong>
<strong>&lt;mode?rwx&gt; &lt;links&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;filename&gt;</strong>
$ LC_ALL=C ls -al --time-style="+%F %T" DIR 2&gt;/dev/null | sed '/^total /d' | awk '($8 != "." &amp;&amp; $8 != "..") {print $0}'


<strong><span style="text-decoration: underline;">List ALL files from DIR, No Sort<strong>, date (mtime)</strong></span>
SPE_CMD_LS
OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;mode?rwx&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;filename&gt;</strong>
$ STD_CMD_LS_ALL | awk '{ fname=""; for (i=8; i &lt;= NF; i++) fname=fname $i " "; print $6" "$7" "$1" "$3" "$4" "$5" "fname }'


<strong><span style="text-decoration: underline;">List ALL files from DIR, No Sort<strong>, date (mtime)</strong></span>
SPE_CMD_STAT
OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;mode?rwx&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;filepath&gt;</strong>
$ LC_ALL=C stat -c '%y %A %U %G %s %n' DIR/{*,.*} 2&gt;/dev/null | sed -e 's;&#91;.]&#91;0-9]\{9\} +&#91;0-9]\{4\};;g'</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">List regular files/dirs/symlinks from DIR, No Sort, date (mtime)</span>
STD_CMD_LS_FDL
OUTPUT: &lt;mode?rwx&gt; &lt;links&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;filepath&gt;</strong>
$ STD_CMD_LS_ALL | grep '^-\|^d\|^l'


<strong><span style="text-decoration: underline;">List regular files/dirs/symlinks from DIR, No Sort, date (mtime)</span>
SPE_CMD_LS_FDL
OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;mode?rwx&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;filename&gt;</strong>
$ STD_CMD_LS_FDL | awk '{ fname=""; for (i=8; i &lt;= NF; i++) fname=fname $i " "; print $6" "$7" "$1" "$3" "$4" "$5" "fname }'</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong>List <strong><strong><strong>regular files</strong></strong>/dirs/symlinks from</strong> DIR</strong>, Sort: ascending date (mtime)</span></strong>
<strong>CMD_LS_FDL_MTIME_SORT_ASC</strong>
<strong><span style="text-decoration: underline;">OUTPUT:</span> &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt; <strong><strong>&lt;gname&gt;</strong></strong></strong> <strong>&lt;size_bytes&gt; &lt;filename&gt;</strong>

$ SPE_CMD_LS_FDL | sort</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">List regular files/dirs/symlinks from DIR, Sort: descending date (mtime)</span></strong>
<strong><strong>CMD_LS_FDL_MTIME_SORT</strong>_DESC</strong>
<strong><span style="text-decoration: underline;">OUTPUT</span>: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt; <strong><strong><strong>&lt;gname&gt;</strong></strong></strong> &lt;size_bytes&gt; &lt;filename&gt;</strong>

$ SPE_CMD_LS_FDL | sort -r</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong>List regular files/dirs/symlinks from DIR</strong>, Latest and Oldest (mtime)</span></strong>
<strong><span style="text-decoration: underline;">OUTPUT</span>: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt; <strong><strong><strong><strong>&lt;gname&gt;</strong></strong></strong> </strong>&lt;size_bytes&gt; &lt;filename&gt;</strong>

$ CMD_LS_FDL_MTIME_SORT_DESC | sed -n '1p;$p'</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong><strong>List regular files/dirs/symlinks from DIR</strong></strong>, Sort: ascending filename</span></strong>
<strong><span style="text-decoration: underline;">OUTPUT</span>: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt;<strong> <strong><strong><strong><strong>&lt;gname</strong></strong></strong></strong></strong>&gt; &lt;size_bytes&gt; &lt;filename&gt;</strong>

$ SPE_CMD_LS_FDL | sort -k7</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong><strong><strong>List regular files/dirs/symlinks from DIR</strong></strong>,</strong> Sort: descending size</span></strong>
<strong><span style="text-decoration: underline;">OUTPUT</span>: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt; <strong><strong><strong><strong><strong><strong>&lt;gname</strong></strong></strong></strong></strong>&gt; </strong>&lt;size_bytes&gt; &lt;filename&gt;</strong>

$ SPE_CMD_LS_FDL | sort -k6n,6nr</code></pre>



<h2>Recursive</h2>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">List ALL (not hidden) files from DIR, Recursive, No Sort, date (mtime)</span></strong>
<strong>Standard command ls -R without headers</strong>
<strong>OUTPUT: &lt;mode?rwx&gt; &lt;links&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;filepath&gt;
</strong>
$ LC_ALL=C ls -lR --time-style='+%F %T' DIR 2&gt;/dev/null | sed '/:$/,/^total &#91;0-9]\{1,\}/d' | tr -s '\n'


<strong><span style="text-decoration: underline;">List ALL (hidden) files from DIR, Recursive, No Sort, date (mtime)</span></strong>
<strong>Standard command ls -R without headers</strong>
<strong>OUTPUT: &lt;mode?rwx&gt; &lt;links&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;filepath&gt;
</strong>
$ LC_ALL=C ls -alR --time-style='+%F %T' DIR 2&gt;/dev/null | sed '/:$/,/^total &#91;0-9]\{1,\}/d' | tr -s '\n' | awk '($8 != "." &amp;&amp; $8 != "..") {print $0}'</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong><strong>List regular files/dirs/symlinks from DIR</strong></strong>, Recursive, No Sort, date (mtime)</span></strong>

<strong>CMD_FIND_FDL_RECURSIVE_STAT_MTIME</strong>
<strong><span style="text-decoration: underline;">OUTPUT</span>: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt; <strong>&lt;gname&gt; </strong>&lt;size_bytes&gt; &lt;filepath&gt;</strong>

$ LC_ALL=C find DIR \( -type f -o -type d -o -type l \) -exec stat -c '%y %A %U %G %s %n' {} + 2&gt;/dev/null | sed 's;&#91;.]&#91;0-9]\{9\} &#91;+-]&#91;0-9]\{4\};;'


<strong>CMD_FIND_FDL_RECURSIVE_LS_MTIME</strong>
<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt;<strong> <strong>&lt;gname&gt;</strong></strong> &lt;size_bytes&gt; &lt;filepath&gt;</strong>

$ LC_ALL=C find DIR \( -type f -o -type d -o -type l \) -exec ls -ld --time-style="+%F %T" {} + 2&gt;/dev/null | awk '{ fname=""; for (i=8; i &lt;= NF; i++) fname=fname $i " "; print $6" "$7" "$1" "$3" "$4" "$5" "fname }'


<strong>CMD_LS_FDL_RECURSIVE_MTIME</strong>
<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt; <strong><strong><strong>&lt;gname&gt;</strong></strong> </strong>&lt;size_bytes&gt; &lt;filename&gt;</strong>

$ LC_ALL=C ls -alR --time-style="+%F %T" DIR 2&gt;/dev/null | grep '^-\|^d\|^l'  | awk '($8 != "." &amp;&amp; $8 != "..") {print $0}' | awk '{ fname=""; for (i=8; i &lt;= NF; i++) fname=fname $i " "; print $6" "$7" "$1" "$3" "$4" "$5" "fname }'
</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong><strong><strong><strong><strong><strong>List regular files/dirs/symlinks from DIR</strong></strong></strong></strong></strong></strong>, Recursive, Sort: descending date (mtime)</span></strong>

<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt;<strong> <strong><strong><strong>&lt;gname&gt;</strong></strong></strong></strong> &lt;size_bytes&gt; &lt;filepath&gt;</strong>
<strong>CMD_FIND_FDL_RECURSIVE_STAT_MTIME_SORT_DESC</strong>

$ CMD_FIND_FDL_RECURSIVE_STAT_MTIME | sort -r


<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt; <strong><strong><strong><strong><strong>&lt;gname&gt;</strong></strong></strong></strong></strong> &lt;size_bytes&gt; &lt;filepath&gt;</strong>
<strong>CMD_FIND_FDL_RECURSIVE_LS_MTIME_SORT_DESC</strong>

$ CMD_FIND_FDL_RECURSIVE_LS_MTIME | sort -r


<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt; <strong><strong><strong><strong><strong>&lt;gname&gt;</strong></strong></strong></strong></strong></strong> <strong>&lt;size_bytes&gt; &lt;filename&gt;</strong>
<strong>CMD_LS_FDL_RECURSIVE_MTIME_SORT_DESC</strong>

$ CMD_LS_FDL_RECURSIVE_MTIME | sort -r</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong><strong><strong>List regular files/dirs/symlinks from DIR</strong></strong></strong>, Recursive, Latest and Oldest (mtime)</span></strong>

<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt;<strong> <strong><strong><strong><strong><strong>&lt;gname&gt;</strong></strong></strong></strong></strong></strong> &lt;size_bytes&gt; &lt;filepath&gt;</strong>

$ CMD_FIND_FDL_RECURSIVE_STAT_MTIME_SORT_DESC | sed -n '1p;$p'
$ CMD_FIND_FDL_RECURSIVE_LS_MTIME_SORT_DESC | sed -n '1p;$p'


<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt;<strong><strong> <strong><strong><strong><strong><strong>&lt;gname&gt;</strong></strong></strong></strong></strong></strong> </strong>&lt;size_bytes&gt; &lt;filename&gt;</strong>

$ CMD_LS_FDL_RECURSIVE_MTIME_SORT_DESC | sed -n '1p;$p'</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong><strong><strong><strong>List regular files/dirs/symlinks from DIR</strong></strong></strong></strong>, Recursive, Sort: ascending filepath</span></strong>

<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt;<strong><strong> <strong><strong><strong><strong><strong>&lt;gname&gt;</strong></strong></strong></strong></strong></strong></strong> &lt;size_bytes&gt; &lt;filepath&gt;</strong>

$ CMD_FIND_FDL_RECURSIVE_STAT_MTIME | sort -k7
$ CMD_FIND_FDL_RECURSIVE_LS_MTIME | sort -k7


<strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;mode?rwx&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;filename&gt;
</strong>
$ CMD_LS_FDL_RECURSIVE_MTIME | sort -k7</code></pre>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;"><strong><strong><strong><strong><strong>List regular files/dirs/symlinks from DIR</strong></strong></strong></strong>,</strong> Recursive, Sort: descending size</span></strong>

<strong><strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; <strong>&lt;<strong>mode?rwx</strong>&gt;</strong> &lt;uname&gt;<strong><strong> <strong><strong><strong><strong><strong>&lt;gname&gt;</strong></strong></strong></strong></strong></strong></strong> &lt;size_bytes&gt; &lt;filepath&gt;</strong></strong>

$ CMD_FIND_FDL_RECURSIVE_STAT_MTIME | sort -k6n,6nr
$ CMD_FIND_FDL_RECURSIVE_LS_MTIME | sort -k6n,6nr


<strong><strong>OUTPUT: &lt;mdate YYYY-MM-DD&gt; &lt;mtime hh:mm:ss&gt; &lt;mode?rwx&gt; &lt;uname&gt; &lt;gname&gt; &lt;size_bytes&gt; &lt;filename&gt;</strong></strong>
$ CMD_LS_FDL_RECURSIVE_MTIME | sort -k6n,6nr</code></pre>



<h2>List/Delete Empty Directories</h2>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">List Empty Directories</span></strong>
$ find DIR -type d -empty 2&gt;/dev/null

<strong><span style="text-decoration: underline;">Delete Empty Directories (verbose)</span></strong>
$ find DIR -type d -empty -exec rmdir -v {} +</code></pre>



<h2>List/Delete Empty Files</h2>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">List Empty Files</span></strong>
$ find DIR -type f -empty 2&gt;/dev/null

<strong><span style="text-decoration: underline;">Delete Empty Files (verbose)</span></strong>
$ find DIR -type f -empty -exec rm -v {} +</code></pre>



<h2>List Top 100 biggest files from DIR</h2>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">By default 'du' command print the real disk usage in blocks of 1024 bytes (number of used blocks) rather than the logical file' size (raw data in bytes). If you want to show the logical size use -b, --bytes equivalent to '--apparent-size --block-size=1' option</span></strong>.

$ man du
Display  values  are  in  units of the first available SIZE from --block-size, and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables. <strong><span style="text-decoration: underline;">Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set)</span></strong>.


<span style="text-decoration: underline;"><strong>Real disk usage in blocks</strong></span><strong><span style="text-decoration: underline;"> (default: 1block=1024bytes)</span></strong>
$ LC_ALL=C find DIR -type f -exec du {} + 2&gt;/dev/null | sort -nr | head -n100

<span style="text-decoration: underline;"><strong>Logical file's size in bytes</strong></span>
$ LC_ALL=C find DIR -type f -exec du -b {} + 2&gt;/dev/null | sort -nr | head -n100
$ LC_ALL=C find DIR -type f -exec du -b -h {} + 2&gt;/dev/null | sort -hr | head -n100

<strong><span style="text-decoration: underline;">List Top 100 biggest files in blocks</span></strong>
$ LC_ALL=C find / -type f -exec du {} + 2&gt;/dev/null | sort -nr | head -n100</code></pre>



<h2>Get directory size (content)</h2>



<pre class="wp-block-code"><code><span style="text-decoration: underline;"><strong>Real disk usage in blocks</strong></span><strong><span style="text-decoration: underline;"> (default: 1block=1024bytes), hidden subdirectories excluded</span></strong>
$ du -s --exclude=.* DIR 2&gt;/dev/null

<strong><span style="text-decoration: underline;">Logical directory's size in bytes (approximation), hidden subdirectories excluded</span></strong>
$ du -sb --exclude=.* DIR 2&gt;/dev/nul<strong><span style="text-decoration: underline;"></span></strong></code></pre>



<h2>List (sub)directories size + mtime from DIR, sort by size</h2>



<pre class="wp-block-code"><code><span style="text-decoration: underline;"><strong>Limiting Directory Tree Depth: 2</strong></span>

<strong><span style="text-decoration: underline;">Real disk usage in blocks (default: 1block=1024bytes), hidden subdirectories excluded</span></strong>
$ du -d2 --time --time-style='+%F %T' --exclude=.* DIR 2&gt;/dev/null | sort -nr

<strong><span style="text-decoration: underline;">Logical file's size in bytes (approximation), hidden subdirectories excluded</span></strong>
$ du  -d2 -b   --time --time-style='+%F %T' --exclude=.* DIR 2&gt;/dev/null | sort -nr
$ du  -d2 -bh --time --time-style='+%F %T' --exclude=.* DIR 2&gt;/dev/null | sort -hr</code></pre>



<h2>List (sub)directories size + mtime from DIR, sort by name</h2>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">Limiting Directory Tree Depth: 2</span></strong>

<strong><span style="text-decoration: underline;">Real disk usage in blocks (default: 1block=1024bytes), hidden subdirectories excluded</span></strong>
$ du -d2 --time --time-style='+%F %T' --exclude=.* DIR 2&gt;/dev/null | sort -k4

<strong><span style="text-decoration: underline;">Logical file's size in bytes (approximation), hidden subdirectories excluded</span></strong>
$ du  -d2 -b   --time --time-style='+%F %T' --exclude=.* DIR 2&gt;/dev/null | sort -k4
$ du  -d2 -bh --time --time-style='+%F %T' --exclude=.* DIR 2&gt;/dev/null | sort -k4</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
