Created
June 21, 2016 07:17
-
-
Save tanaypratap/5d6cf479912a69b1b08b538a8ff68bc9 to your computer and use it in GitHub Desktop.
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
cp `ls -SF | grep .log` /path/to/where/you/want/to/copy | |
Note 1: notice the backtick it's not inverted comma | |
Note 2: if you want to copy only files ending with .log for example, training1.log (yes) but training2.log.gz (no) | |
then use $ like: | |
cp `ls -SF | grep .log$` /path/to/where/you/want/to/copy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To limit the number of files to be copied you can use grep -m 100
this copies first 100 files.