CompTIA
XK0-005 · Question #10640
A user is cleaning up a directory because it has more than 100,000 files that were generated from an experiment. When the user tries to remove the unneeded experiment files, the user receives an…
The correct answer is A. find . -name "experiment*.txt" -exec rm "{}". The "Argument list too long" error occurs when the number of files exceeds the command-line argument limit. The find command with -exec is a workaround, as it processes files one by one, avoiding the argument limit. This method is efficient for handling large numbers of files.
Troubleshooting
Question
A user is cleaning up a directory because it has more than 100,000 files that were generated from an experiment. When the user tries to remove the unneeded experiment files, the user receives an error: arduino cannot execute [Argument list too long] Which of the following should the user execute to remove these files?
Options
- Afind . -name "experiment*.txt" -exec rm "{}" ;
- Brm -rf experiment*.txt
- Crm --force experiment*.txt
- Dfor i in experiment*.txt; do find . -name $i -exec rmdir "{}" ; done
How the community answered
(30 responses)- A73% (22)
- B3% (1)
- C7% (2)
- D17% (5)
Explanation
The "Argument list too long" error occurs when the number of files exceeds the command-line argument limit. The find command with -exec is a workaround, as it processes files one by one, avoiding the argument limit. This method is efficient for handling large numbers of files.
Topics
#file management#command line utilities#argument list limit#linux administration
Community Discussion
No community discussion yet for this question.