4 ms·
It might be faster, but it won't work for large directories. For large directories, I either use 'ls --color=never' or the example C program in 'man 2 getdents
by MichaelBurge 11y ago
It might be faster, but it won't work for large directories.
For large directories, I either use 'ls --color=never' or the example C program in 'man 2 getdents'.
- gnosek 11y agols -U avoids the default sort by name. Without -U you get all the names at once at the end of the directory scan. With the option you get them one by one (in some unspecified order) and can make sort of a progress bar for counting files in large directories: ls -U huge_dir | awk 'NR % 100000 == 0 { print NR } END { print NR }' (prints the count every 100k files and the total at the end).
- sua_mae 11y ago/bin/ls do the trick to avoid all options on the alias.