I have a folder in Linux with 15M
files and I want to list the first 5 files. I was trying the following command:
ls -lart | head -5
However, this does not work and stuck for a long time. What would be the alternate way?
Also how to find out how many files are there in this directory? As I see using commands like the following is stuck for a long time as well.
ls -lart | wc -l
Also if I have to copy all these files from one folder to another what would be the option.
cp -pR *.txt another_folder
?
question from:
https://stackoverflow.com/questions/65843477/how-to-list-file-in-a-folder-with-millions-of-file-in-linux 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…