Ubuntu - xargs

The xargs command is a command-line tool used to read data from standard input and later run a command based on this input.

It is a useful tool in file management, especially when used with other commands such as mkdir, grep, rm etc.


Basic Syntax

Copying Files to Multiple Directories

Limit Output per Line

List Number of Lines/Words/Characters in Each File

Read Items From File

Run Multiple commands with xargs

Specify the Delimiter

Trim blank spaces from a String

Using xargs with find

Using xargs with grep

View commands executed by xargs