xargs Flashcards

1
Q

xargs

A

xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or newlines, and executes the command (default is /bin/echo) one or more times with any initial-arguments followed by items read from standard input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

xargs -a file1.txt

A

This command will read file1.txt and displays the contents.

-a file, –arg-file=file, Read items from file instead of standard input. If this option is used stdin remains unchanged when commands are run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

xargs -p -a file1.txt

A

The -p option prompts for confirmation before running each command.

-p, –interactive, Prompt the user about whether to run each command line and read a line from the terminal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

xargs -L

A

-L max-lines, Use at most max-lines nonblank input lines per command line. Trailing blanks cause input line to be logically continued on the next input line. Implies -x.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

xargs -n

A

-n max-args, –max-args=max-args, Use at most max-args arguments per command line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly