bug#40904: listing multiple subdirectories places filenames in different columns between each subdirectory
On 4/27/20 7:36 AM, Jim Clark wrote: > When I list a hard drive "ls -AR > list.txt" and import it into Libreoffice > Calc, then break the lines using "text-to-columns", I am not able to > perform a fixed format break so that the filenames are placed in their own > column. I can't reproduce the problem. All the file names start at the beginning of the line. Quite possibly you're using an alias, so that your 'ls' is not the plain vanilla 'ls'. At any rate, 'find' is probably a better tool for what you want to d.
bug#40903: the "ls -R *.pdf" command does not search recursively only current dir
tag 40903 notabug thanks On 4/27/20 9:25 AM, Jim Clark wrote: Greetings, I found the ls command when used with a pattern does not search recursively. ls -R *.pdf only searches the current directory and not recursively. You are forgetting that globs expand prior to invoking ls. What you have invoked is something like: ls -R a.pdf b.pdf which says to recursively list all files starting with a.pdf or b.pdf, and descending if any of those files are a directory, but neither a.pdf nor b.pdf is a directory, so there is nothing to descend into. Instead of trying to mess with how globbing interacts with ls, you are better off learning how to use 'find', which does recursion and filtering as its primary goal. In this case, you would use: find . -name '*.pdf' which gives you a recursive listing of all directories under '.', then filters it out to files ending in .pdf. As the action of globbing is done by your shell and not by ls, there is nothing to change in coreutils, so I'm closing this as not a bug. But feel free to respond with further questions on the topic. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
bug#40904: listing multiple subdirectories places filenames in different columns between each subdirectory
Greetings, When I list a hard drive "ls -AR > list.txt" and import it into Libreoffice Calc, then break the lines using "text-to-columns", I am not able to perform a fixed format break so that the filenames are placed in their own column. It seems like, when listing all subdirectories the largest file size within the subdirectory places the filename at a column and all the other names in that subdirectory are at the same column, but other subdirectories will have their filenames at different columns depending on file size within that subdirectory. It would be nice if all the filenames were at the same column in the directory and all subdirectories. -- Thank you, Jim Clark
bug#40903: the "ls -R *.pdf" command does not search recursively only current dir
Greetings, I found the ls command when used with a pattern does not search recursively. ls -R *.pdf only searches the current directory and not recursively. -- Thank you, Jim Clark