Created
June 21, 2022 06:50
-
-
Save SalvadorP/40da9fb32a03fddec457716483efcd17 to your computer and use it in GitHub Desktop.
Picks files by filename and then copies them to a destination folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Searches for filenames and then copies them to the destination folder. | |
# Searches for first parameter then copies where the second says. | |
ls | grep "$1" | while read i; do cp -p "$i" $2 ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment