FAST ACCESS

sysCore ApS
Tel: +45 32 21 57 70
Fax: +45 69 66 33 66
E-mail: info@syscore.dk
Glostrup, Denmark

Quick Product & Service Guide
Competences | Services | AppHost | Clip-card support | B2B SHOP | Online Presence Pack | RFID | sysAlarms
Google Apps for Business | WADA-NET | CLUB-NET

HCORE Skræddersyet webløsninger
Vi er en del af H|CORE
Autoriseret UNI-TEL forhandler

Autoriseret forhandler
Autoriseret NAVICAT forhandler

Autoriseret forhandler
INNOVARE logo
sysCore Aps supports Foundation INNOVARE
meetBSD logo
sysCore Aps supports meetBSD Conference

find + xargs and spaces in paths

Spaces in paths can be a real pain – especially when doing some bulk processing. To keep it quick – how do you then for example look for all AVI files in a given directory and feed them to mplayer? (and the paths DO contain spaces)

Here’s the magic command:

find . -iname '*.avi' -print0 | xargs -0 mplayer

It does exactly what you need. Below is a relevant paste of xargs‘ manpage:

       --null
       -0     Input  items  are  terminated  by a null character instead of by
              whitespace, and the quotes and backslash are not special  (every
              character is taken literally).  Disables the end of file string,
              which is treated like any other  argument.   Useful  when  input
              items  might  contain  white space, quote marks, or backslashes.
              The GNU find -print0 option produces  input  suitable  for  this
              mode.
Posted in howto, linux | Tagged , | Comments Off on find + xargs and spaces in paths