From the course: Linux Tips
Unlock this course with a free trial
Join today to access over 22,400 courses taught by industry experts.
Using xargs - Linux Tutorial
From the course: Linux Tips
Using xargs
- [Instructor] Xargs takes information from standard input and converts it to arguments that can be used in a command. In most cases, it's used to take a list of some kind and use each item in that list as an argument for a command. While it can seem a little bit exotic at first, xargs allows us to do some pretty powerful things. Let's look at copying files as a specific example. If we wanted to copy all the files in a folder that match certain criteria somewhere else, that's pretty easy. We'd just say cp, and then an expression describing what files we want to copy to somewhere. But what if we wanted to copy files that match certain criteria from anywhere on the system to that folder? The cp command isn't clever enough to go out and find things, but the find command is, and the find command returns a list of things that match given criteria. So we can pretty easily find things, but how do we get that list of results into…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
Exploring Windows Subsystem for Linux2m 20s
-
Windows Subsystem for Linux7m 20s
-
Exploring virtualization5m 28s
-
Exploring containers5m 19s
-
Exploring Fedora3m 8s
-
Ubuntu desktop 18.042m
-
Changing the default shell3m 30s
-
Exploring other shells2m 5s
-
Blocking ads on your network with Pi-hole6m 35s
-
Exploring CentOS2m 6s
-
Exploring Zsh5m 41s
-
Osquery4m 28s
-
Exploring fish5m 21s
-
Exploring csh and tcsh2m 34s
-
Using diff to compare files3m 54s
-
Using xargs3m 41s
-
Configuring and managing logs4m 32s
-
Job control3m 59s
-
Using watch and time3m 5s
-
Recording a terminal session3m 14s
-
Exploring Debian1m 49s
-
Exploring SUSE Linux7m 33s
-
Exploring Arch Linux16m 44s
-
Exploring Alpine Linux6m 18s
-
Exploring Linux Mint5m 14s
-
Exploring Amazon Linux5m 8s
-
UNIX time and the 2038 problem6m 36s
-
Visual file management with Midnight Commander5m 42s
-
Terminal on the go5m 1s
-
FUSE and SSHFS3m 54s
-
Removing Linux4m 44s
-
WSL distros on Windows 103m 13s
-
Embedded Linux4m 25s
-
Exploring Netboot2m 43s
-
Exploring ZFS3m 53s
-
Docker on Linux5m 24s
-
-
-