Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Because coming up with the personal favourite solution is big fun, I'll join in:</p> <h3>Solution (Spoiler)</h3> <h2>@user unknown:</h2> <p>I know you're trolling, but in the interest of casual readers: I admit that the inline expansions there are not safe indeed. I was really showing how I had intended to use the commands (ls, find, uniq) etc. in combination. It can be made safe:</p> <pre><code>find -type f -printf '%f\0' | sort -uz | xargs -0i -n1 find -name {} -printf "%f:%p\n" </code></pre> <p>The formatting is slightly less convenient now (then again, <em>how</em> would you format it with special characters in the pathnames?). The question says little on that subject, so...</p> <hr> <p><em>One final note:</em></p> <p><code>the first read is already broken with (...) blanks in filenames</code></p> <ul> <li><strong>untrue</strong> <code>while read</code> is only broken with newlines, try it: <code>read line &lt;&lt;&lt; "a b c" &amp;&amp; echo "'$line'"</code></li> </ul> <h3>Original Didactic Pointers</h3> <p>Use</p> <pre><code>dirname a/b/c/file -&gt; a/b/c basename a/b/c/file -&gt; file ls -t / ls -tr sort files by timestamp; note that 'creation date' is likely a fob because hardly any filesystem stores these reliably (it is usually the last change date for the inode) find -type f find -type d find files or directories sort | uniq sort -u sort lines and remove adjacent (subsequent) duplicates </code></pre> <p>Let me know if that helped. I could give you a tiny step-up besides the pointers to the UNIX commands</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload