<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Files on Michael’s Domain</title><link>https://jeltsch.org/en/tags/files/</link><description>Recent content in Files on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/files/index.xml" rel="self" type="application/rss+xml"/><item><title>Counting files (list and word count, ls &amp; wc)</title><link>https://jeltsch.org/en/counting_files_list_and_word_count_ls_wc/</link><pubDate>Wed, 29 Apr 2020 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/counting_files_list_and_word_count_ls_wc/</guid><description>&lt;p&gt;How do you count the number of files in a directory? That becomes non-trivial if you have thousands of files in a directory. Your file manager chokes on counting them, especially if they are not local. On the Linux command line, this task is fast and easy:&lt;code&gt;ls | wc&lt;/code&gt;ls lists your files one per row and wc returns three numbers: lines, words and bytes. In the file counting example, lines and words are the same and equal the number of files in the directory. To count all files recursively in the directory tree &amp;ldquo;backcheck&amp;rdquo;:&lt;code&gt;find backcheck/ -type f | wc -l&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Copying with rsync</title><link>https://jeltsch.org/en/copy_with_rsync/</link><pubDate>Mon, 17 Feb 2020 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/copy_with_rsync/</guid><description>&lt;p&gt;Reasons why you should (not always, but often) prefer rsync over cp:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Resume Interrupted Transfers
If you are copying a large file and your terminal session crashes or the power cuts out, cp will simply fail, and you have to start over. rsync can pick up right where it left off, which is a massive time-saver for large datasets.&lt;/li&gt;
&lt;li&gt;Efficiency (Delta-Transfer Algorithm)
rsync is designed to be smart. If you are copying a file that already exists at the destination (e.g., you are updating a backup), rsync only copies the parts of the file that have actually changed (the &amp;ldquo;delta&amp;rdquo;) rather than overwriting the entire file. cp, by contrast, always copies the whole file every single time.&lt;/li&gt;
&lt;li&gt;Real-time Progress Monitoring
rsync provides excellent visual feedback. By using the -P (or &amp;ndash;progress) flag, you get a real-time progress bar showing the percentage complete, transfer speed, and estimated time remaining. cp is famously silent, leaving you guessing whether the process is still running or has hung, requiring you to check at the destination via the size of the arriving file, whether anything is progressing (ls -lh filename, or du -hs filename)&lt;/li&gt;
&lt;li&gt;Seamless Remote Transfers
rsync is natively built to work over SSH. You can use it to copy files directly to or from a remote server as easily as copying files on your local machine. cp cannot do this; to use cp for a remote server, you would first need to mount the remote filesystem locally, which is far more complex and prone to errors.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is a common use case, the transfer of a directory, including all of its content:&lt;/p&gt;</description></item><item><title>Passwordless login via the GUI and ssh defaults</title><link>https://jeltsch.org/en/passwordless/</link><pubDate>Mon, 25 Mar 2019 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/passwordless/</guid><description>&lt;p&gt;I use cloud services at 
 &lt;a href="https://csc.fi" target="_blank" rel="noopener noreferrer nofollow"&gt;CSC&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 (e.g. pouta.csc.fi), and they do not allow SSH login with a traditional username/password combo. When I want to make a bookmark in my file manager (Nemo oder Nautilus/Files), pointing to this location. I need to specify an RSA key file that is used for the login. On the command line, it looks as follows:&lt;/p&gt;</description></item><item><title>File permissions on html server (recursive chmod) differentiating between files and directories</title><link>https://jeltsch.org/en/file_permissions_on_html_server_recursive_chmod_differentiating_between_files_and_directories/</link><pubDate>Sun, 12 Apr 2009 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/file_permissions_on_html_server_recursive_chmod_differentiating_between_files_and_directories/</guid><description>&lt;p&gt;I recursively screwed up the file permissions in my html servers root directory. To fix it I needed to deploy some &amp;ldquo;advanced&amp;rdquo; chmod settings. Obviously I want to treat directories and files differently. I didn&amp;rsquo;t come up with a better solution than the following:&lt;code&gt;chmod -R u=rw-x,g=rw-x,o=r-wx *chmod -R a+X *&lt;/code&gt;&lt;/p&gt;</description></item></channel></rss>