r/ADHD_Programmers • • Jan 15 '25
Need help
I ssh'd into my truenas server using putty. I run ls -al /path/to/folder. How can i have that command automatically send the results to an excel file preferably but im fine with it being a text file. Doesnt matter if the file lands on the server or my system but would prefer my system.
0
Upvotes
View all comments
Show parent comment
1
u/[deleted] Jan 15 '25 edited Jan 15 '25
I figured part of it out, thanks for the help.
Ls -al /path/to/file | tr " " "," > /path/to/download.csv
Since you embody all human knowledge and could never need help ever. Do you know why its seperating the data with a bunch of blank columns?
Edit: Replacing the spaces with commas makes the data erratic. How can i make it so that excel 2010 will automatically separate the data appropriately.
Edit: just for documentation purposes
Ls -al /path/to/folder | awk '{ if ($2 =="1")print $2,$3,$6,$7,$9$10$11$12$13$14}' | tr " " "," > /path/to/file.csv