I have the following ls command lists the first 93 files
ls -lrt | head -93
but when i try piping this to scp like
scp 'ls -lrt | head -93' {} test@testserver:~/DIR1/SUBDIR
I recieve an error saying ls -lrt | head -93: No such file or directory
Can someone tell me what im doing wrong please?
I assume that you want to transfer the first 93 files to the remote system. If so, try:
scp $(ls -1rt | head -93) test@testserver:~/DIR1/SUBDIR
$(...)
denotes Command Substitution. Moreover, you don't want the long listing from ls
, so replace -l
with -1
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With