Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
Folder Content List
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="vansmith" data-source="post: 1284967" data-attributes="member: 71075"><p>Mine is incorrect (according to your needs) - it should be the following:[code]ls -lH | awk '{print $3 "," $6 " " $7 " " $8 "," $9}'[/code]which prints out the following:[code], ,</p><p>vansmith,21 Mar 23:20,main.py[/code]To be honest, I wasn't sure how to get rid of the first line (which represents the file count printed back by the "-l" switch). If I did this with directories and attempted to do it recursively, I got the following:[code], ,</p><p>vansmith,20 Jul 13:50,src</p><p>vansmith,18 Aug 12:42,test.txt</p><p>, ,</p><p>, ,</p><p>, ,</p><p>vansmith,21 Mar 23:20,main.py[/code]In that case, test.txt and the "src" folder are at one level and the main.py file is in the src folder. After some fiddling, I have come up with the following:[code]ls -lHRh | awk '{if ($3 != "") print $3 "," $5 "," $6 " " $7 " " $8 "," $9}'[/code]That outputs the following (as "user,size,modification date,file/folder"):[code]vansmith,102B,20 Jul 13:50,src</p><p>vansmith,0B,18 Aug 12:42,test.txt</p><p>vansmith,4.3K,21 Mar 23:20,main.py[/code]The only final problem I see is that you have no way of telling what is in the src folder (as I noted, the "main.py" file is in that folder). If I figure that out, I'll report back.</p><p></p><p>Dysfunction's solution probably works better. I'm partly doing this for the learning now. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /></p></blockquote><p></p>
[QUOTE="vansmith, post: 1284967, member: 71075"] Mine is incorrect (according to your needs) - it should be the following:[code]ls -lH | awk '{print $3 "," $6 " " $7 " " $8 "," $9}'[/code]which prints out the following:[code], , vansmith,21 Mar 23:20,main.py[/code]To be honest, I wasn't sure how to get rid of the first line (which represents the file count printed back by the "-l" switch). If I did this with directories and attempted to do it recursively, I got the following:[code], , vansmith,20 Jul 13:50,src vansmith,18 Aug 12:42,test.txt , , , , , , vansmith,21 Mar 23:20,main.py[/code]In that case, test.txt and the "src" folder are at one level and the main.py file is in the src folder. After some fiddling, I have come up with the following:[code]ls -lHRh | awk '{if ($3 != "") print $3 "," $5 "," $6 " " $7 " " $8 "," $9}'[/code]That outputs the following (as "user,size,modification date,file/folder"):[code]vansmith,102B,20 Jul 13:50,src vansmith,0B,18 Aug 12:42,test.txt vansmith,4.3K,21 Mar 23:20,main.py[/code]The only final problem I see is that you have no way of telling what is in the src folder (as I noted, the "main.py" file is in that folder). If I figure that out, I'll report back. Dysfunction's solution probably works better. I'm partly doing this for the learning now. ;) [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Operating System
Folder Content List
Top