I want to copy some files (created by jenkins) from a specific folder on the server to another server. My Jenkins scripts creates backup folders something like backup-1, backup-2 and backup-3 this is for the sake of example
Now i want a script to copy the content of latest build backup-3
in our example.
I know ls -t1 backup* | head -n 1
but it output something like backup-3:
how can i remove the ":". notice that there are another folders and files besides backup* in the desired path.