<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:18:53 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-15504] &quot;lfs find&quot; is missing &quot;-ls&quot; support</title>
                <link>https://jira.whamcloud.com/browse/LU-15504</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;It would be useful to be able to add the &quot;&lt;tt&gt;&amp;#45;ls&lt;/tt&gt;&quot; option to &quot;&lt;tt&gt;lfs find&lt;/tt&gt;&quot; to print out file attributes.&lt;/p&gt;

&lt;p&gt;Even better would be if &lt;tt&gt;&amp;#45;ls&lt;/tt&gt; was implemented as a fixed-format option of the &quot;&lt;tt&gt;&amp;#45;&amp;#45;printf&lt;/tt&gt;&quot; command, which could print out POSIX and possibly some limited Lustre-specific attributes such as FID, stripe_count.&lt;/p&gt;</description>
                <environment></environment>
        <key id="68412">LU-15504</key>
            <summary>&quot;lfs find&quot; is missing &quot;-ls&quot; support</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>lad23dd</label>
                            <label>lug23dd</label>
                            <label>medium</label>
                    </labels>
                <created>Mon, 31 Jan 2022 01:35:27 +0000</created>
                <updated>Tue, 19 Sep 2023 10:48:13 +0000</updated>
                                            <version>Lustre 2.10.0</version>
                                    <fixVersion>Lustre 2.16.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="351389" author="adilger" created="Tue, 1 Nov 2022 19:13:19 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=georgea&quot; class=&quot;user-hover&quot; rel=&quot;georgea&quot;&gt;georgea&lt;/a&gt;, is this something that you and/or &lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=rmohr&quot; class=&quot;user-hover&quot; rel=&quot;rmohr&quot;&gt;rmohr&lt;/a&gt; are planning to implement for 2.16.0? If not, hopefully the following notes will be useful to you or whomever looks into this in the future.&lt;/p&gt;

&lt;p&gt;I haven&apos;t looked into the details, but it looks reasonable to have the &quot;&lt;tt&gt;-ls&lt;/tt&gt;&quot; option internally map to &quot;&lt;tt&gt;-printf&lt;/tt&gt;&quot; with a static format string to match the output format of the normal &quot;&lt;tt&gt;find&lt;/tt&gt;&quot; command:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;$ find /etc -ls | head -10
130563   12 drwxr-xr-x  94   root   root      12288 Oct 25 17:15 /etc
146902    4 drwxr-xr-x   3   root   root       4096 Sep 30 13:41 /etc/tuned
131968    4 -rw-r--r--   1   root   root       1305 Sep 21 07:17 /etc/tuned/tuned-main.conf
131975    4 -rw-r--r--   1   root   root         14 Oct 21 14:12 /etc/tuned/active_profile
146903    4 drwxr-xr-x   2   root   root       4096 Sep 21 07:17 /etc/tuned/recommend.d
146040    4 -rw-r--r--   1   root   root          5 Oct 21 14:12 /etc/tuned/profile_mode
131967    4 -rw-r--r--   1   root   root       1111 Mar 21  2019 /etc/tuned/bootcmdline
130615    4 ----------   1   root   root        859 Jul 20  2020 /etc/shadow-
130967    0 lrwxrwxrwx   1   root   root         10 Jan 25  2022 /etc/rc0.d -&amp;gt; rc.d/rc0.d
167146 &#160; &#160;4 -rw-r--r-- &#160; 1   root &#160;&#160;root &#160; &#160; &#160; 1968 Apr 11 &#160;2018 /etc/mail.rc
#inode  kbs   sym_mode lnk usrnam grpnam size_bytes  modify_time pathname
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This looks like &quot;&lt;tt&gt;%i\t%k\t%M\t%n\t%u\t%g\t%s\t%t\t%p&lt;/tt&gt;\n&quot; would be at least a good first approximation, according to the Linux manpage.&lt;/p&gt;

&lt;p&gt;It looks like a few additional &lt;tt&gt;-printf&lt;/tt&gt; options would need to be implemented, but nothing overly complex:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%i&lt;/tt&gt;&quot; - inode number (should be trivial).&#160; For Lustre it might be more useful to print &quot;&lt;tt&gt;%LF&lt;/tt&gt;&quot; for the FID instead of the inode number&quot;?&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%k&lt;/tt&gt;&quot; - file blocks in kilobytes (should be trivial, just &quot;&lt;tt&gt;%b/2&lt;/tt&gt;&quot;)&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%M&lt;/tt&gt;&quot; - symbolic file access mode (a small amount of work, decode file type (&lt;tt&gt;-bcdls&lt;/tt&gt;) + &lt;tt&gt;-rwxSt&lt;/tt&gt; UGO permission bits)&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%n&lt;/tt&gt;&quot; - link count (should be trivial)&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%u&lt;/tt&gt;&quot; - username (could be mapped to &quot;&lt;tt&gt;%U&lt;/tt&gt;&quot; initially to print numeric UID, and implemented separately)&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%g&lt;/tt&gt;&quot; - groupname (use &quot;&lt;tt&gt;%g&lt;/tt&gt;&quot; initially, as with &quot;&lt;tt&gt;%u&lt;/tt&gt;&quot;)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Comparing the output of regular &quot;&lt;tt&gt;find -printf &apos;%i\t%k\t%M\t%n\t%u\t%g\t%s\t%t\t%p&lt;/tt&gt;\n&apos;&quot; with &quot;&lt;tt&gt;find -ls&lt;/tt&gt;&quot; shows they are fairly close:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[root@centos7 ~]# find /etc -printf &quot;%i\t%k\t%M\t%n\t%u\t%g\t%s\t%t\t%p\n&quot; | head -10
130563	12	drwxr-xr-x	94	root	root	12288	Tue Oct 25 17:15:22.0799592647 2022	/etc
146902	4	drwxr-xr-x	3	root	root	4096	Fri Sep 30 13:41:40.0933994189 2022	/etc/tuned
131968	4	-rw-r--r--	1	root	root	1305	Wed Sep 21 07:17:58.0000000000 2022	/etc/tuned/tuned-main.conf
131975	4	-rw-r--r--	1	root	root	14	Fri Oct 21 14:12:37.0195947071 2022	/etc/tuned/active_profile
146903	4	drwxr-xr-x	2	root	root	4096	Wed Sep 21 07:17:58.0000000000 2022	/etc/tuned/recommend.d
146040	4	-rw-r--r--	1	root	root	5	Fri Oct 21 14:12:37.0198948473 2022	/etc/tuned/profile_mode
131967	4	-rw-r--r--	1	root	root	1111	Thu Mar 21 16:10:46.0000000000 2019	/etc/tuned/bootcmdline
130615	4	----------	1	root	root	859	Mon Jul 20 18:27:36.0000000000 2020	/etc/shadow-
130861	0	lrwxrwxrwx	1	root	root	13	Fri Sep 30 13:41:15.0672852655 2022	/etc/rc.local
130847	4	drwxr-xr-x	2	root	root	4096	Fri Sep 30 13:41:39.0487986087 2022	/etc/modprobe.d
[root@centos7 ~]# find /etc -ls | head -10
130563   12 drwxr-xr-x  94 root     root        12288 Oct 25 17:15 /etc
146902    4 drwxr-xr-x   3 root     root         4096 Sep 30 13:41 /etc/tuned
131968    4 -rw-r--r--   1 root     root         1305 Sep 21 07:17 /etc/tuned/tuned-main.conf
131975    4 -rw-r--r--   1 root     root           14 Oct 21 14:12 /etc/tuned/active_profile
146903    4 drwxr-xr-x   2 root     root         4096 Sep 21 07:17 /etc/tuned/recommend.d
146040    4 -rw-r--r--   1 root     root            5 Oct 21 14:12 /etc/tuned/profile_mode
131967    4 -rw-r--r--   1 root     root         1111 Mar 21  2019 /etc/tuned/bootcmdline
130615    4 ----------   1 root     root          859 Jul 20  2020 /etc/shadow-
130861    0 lrwxrwxrwx   1 root     root           13 Sep 30 13:41 /etc/rc.local -&amp;gt; rc.d/rc.local
130847    4 drwxr-xr-x   2 root     root         4096 Sep 30 13:41 /etc/modprobe.d
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Printing out the symlink target would also need a small amount of extra work, not sure how critical that would be for an initial implementation. The timestamps are abbreviated to 3 columns (&quot;&lt;tt&gt;Mon Day Time&lt;/tt&gt;&quot;, or &quot;&lt;tt&gt;Mon Day Year&lt;/tt&gt;&quot; for files over 6 months old), but I&apos;m not sure that is better than having a fixed-format timestamp (though it is a bit longer). Some of the column widths are smaller than a whole tab also, and right justified for the numbers, but I don&apos;t think that is totally critical.&lt;/p&gt;</comment>
                            <comment id="351446" author="georgea" created="Wed, 2 Nov 2022 04:31:12 +0000"  >&lt;p&gt;@Andreas Dilger, Thank you for the detailed notes. Let me read through it and discuss with Rick.&lt;/p&gt;</comment>
                            <comment id="362961" author="adilger" created="Wed, 15 Feb 2023 21:31:50 +0000"  >&lt;p&gt;I also filed &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16561&quot; title=&quot;allow &amp;#39;lfs find -printf&amp;#39; field widths&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16561&quot;&gt;LU-16561&lt;/a&gt; to implement fixed field widths for &quot;&lt;tt&gt;lfs find -printf&lt;/tt&gt;&quot;, which would probably give better results for &quot;&lt;tt&gt;lfs find  -ls&lt;/tt&gt;&quot; than using &quot;\t&quot; for the field separator.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10324">
                    <name>Cloners</name>
                                            <outwardlinks description="Clones">
                                        <issuelink>
            <issuekey id="49717">LU-10378</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="46779">LU-9689</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="25084">LU-5170</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="33365">LU-7495</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="74700">LU-16560</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="70232">LU-15837</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="67329">LU-15276</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="74702">LU-16561</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="46202">LU-9537</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i02gs7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>