Wednesday, May 15, 2024
27
rated 0 times [  27] [ 0]  / answers: 1 / hits: 30025  / 1 Year ago, mon, december 12, 2022, 10:53:05

Is there a command to print the files in a directory in a single column without this additional info? Basically an ls command but with the output format of:



file1.txt
file2.txt
file3.txt


as opposed to :



file1.txt file2.txt 
file3.txt

More From » command-line

 Answers
0

You need the ls command -1 option.



ls -1 /dir


just to clarify. that is ls -(one) /dir; like the number.



from the man ls page:



 -1     list one file per line.  Avoid '
' with -q or -b

[#10323] Wednesday, December 14, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
beateyra

Total Points: 499
Total Questions: 113
Total Answers: 125

Location: Falkland Islands
Member since Mon, Jul 13, 2020
4 Years ago
;