On 5/1/2020 12:22 PM, john doe wrote: > On 5/1/2020 12:14 PM, Didier Spaier wrote: >> Le 01/05/2020 à 11:54, Samuel Thibault a écrit : >>> I don't know if cp will accept a block device as target, but dd will >> >> cp does too, I learned that from Thomas Schmitt. >> >> As it takes some time to complete for a big file and doesn't provide >> an output I usually use it like this/ >> cp /path/to/iso /dev/<name> && echo "Done."
For any one reading, '&& echo done' means that the command was successfull. So the below command will display 'success' if the command exited with exit status '0' and the 'failed' message will be displayed on non-zero exit status ('1' and above).: $ cp src dest && echo success || echo failed If you only want the return code of the command: $ cp src dest; echo $? -- John Doe