Skip to content

Instantly share code, notes, and snippets.

@Mahdisadjadi
Last active September 30, 2015 00:41
Show Gist options
  • Save Mahdisadjadi/aecc453788c7104baa19 to your computer and use it in GitHub Desktop.
Save Mahdisadjadi/aecc453788c7104baa19 to your computer and use it in GitHub Desktop.
Find files with an extension and copy them to a target directory
#!/bin/bash
### find files with ".f" extension in the current directory
### copy them to directory "dirx"
ls -d -1 $PWD/*.f* | xargs -I{} cp "{}" dirx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment