bookmark

xargs: How To Control and Use Command Line Arguments


Description

Find all .bak files in or below the current directory and delete them.

$ find . -name "*.bak" -type f -print | xargs /bin/rm -f

Dealing file names with blank spaces and newline

use -0 option:

$ find . -iname "*.mp3" -print0 | xargs -0 -I mp3file mplayer mp3file

Preview

Tags

Users

  • @jil

Comments and Reviews