We help IT Professionals succeed at work.

Explain the command ls -1tr | head -n -10 | xargs -d '\n' rm -f --

Taras Shumylo
on
436 Views
Last Modified: 2017-04-28
The command is from the post on http://superuser.com/questions/268344/how-do-i-delete-all-but-10-newest-files-in-linux
ls -1tr | head -n -10 | xargs -d '\n' rm -f --

Open in new window

What does the last
--

Open in new window

stands for in this command?
Comment
Watch Question

This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
I open man page for xargs and can not find anything about
--

Open in new window

Why it's not on man page?
Top Expert 2015
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Top Expert 2015

Commented:
imagine deleting files \* and \-rf .... One who wrote the command did very good...