Skip to main content
Tags in title (https://meta.stackexchange.com/q/19190/173448).
Link
jww
  • 103.6k
  • 107
  • 453
  • 975

xargs: ls: terminated by signal 13 when using xargs

code formatting & delete unnecessary stuff
Source Link

find "/var/www/site1/" -maxdepth 1 -type f | xargs ls -1S | head -n 4 | xargs -d '\n' rm -f

I'm using abovethe following command to delete four largest size files in a folder.:

find "/var/www/site1/" -maxdepth 1 -type f | xargs ls -1S | head -n 4 | xargs -d '\n' rm -f 

It works fine, but from time to time throws broken pipe error.

xargs: ls: terminated by signal 13

Anyone can see way to improve this to prevent those kind of issues. Thanks for help.

xargs: ls: terminated by signal 13 

find "/var/www/site1/" -maxdepth 1 -type f | xargs ls -1S | head -n 4 | xargs -d '\n' rm -f

I'm using above command to delete four largest size files in a folder. It works fine, but from time to time throws broken pipe error.

xargs: ls: terminated by signal 13

Anyone can see way to improve this to prevent those kind of issues. Thanks for help.

I'm using the following command to delete four largest size files in a folder:

find "/var/www/site1/" -maxdepth 1 -type f | xargs ls -1S | head -n 4 | xargs -d '\n' rm -f 

It works fine, but from time to time throws broken pipe error:

xargs: ls: terminated by signal 13 
Source Link
xfloys2112
  • 713
  • 1
  • 5
  • 14

xargs: ls: terminated by signal 13

find "/var/www/site1/" -maxdepth 1 -type f | xargs ls -1S | head -n 4 | xargs -d '\n' rm -f

I'm using above command to delete four largest size files in a folder. It works fine, but from time to time throws broken pipe error.

xargs: ls: terminated by signal 13

Anyone can see way to improve this to prevent those kind of issues. Thanks for help.