Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The -I{} specifies that the arguments by results from ls will be placed in the location of the {} called the replacement string. In fact you can use whatever variable name you want instead of {}. For example, the following will also workchanging {} to varX also works,

Code Block
languagebash
ls | xargs -t -IvarX md5 varX
md5 file1.txt
MD5 (file1.txt) = d41d8cd98f00b204e9800998ecf8427e
md5 file2.txt
MD5 (file2.txt) = d41d8cd98f00b204e9800998ecf8427e
md5 file3.txt
MD5 (file3.txt) = d41d8cd98f00b204e9800998ecf8427e

...