Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Try doubling your backslash. It will pass a single backslash down one level of interpretation. Commented Feb 12, 2021 at 15:16
  • Does this answer your question? unix.stackexchange.com/questions/450020/… Commented Feb 12, 2021 at 15:23
  • To quote a string that includes single quotes you can escape the single quotes outside pairs of single quotes with a backslash, e.g. for foo'bar use 'foo'\''bar'. You might have to double the backslashes. Try "'ls -1tr /var/log/ | head -10 | xargs -d '\\''\\n'\\'' -I {} echo {}'". Commented Feb 12, 2021 at 15:25