Reputation: 1087
When i type command
cp notExistsFile.txt ~/Desktop/
its gives an error: "cp: cannot stat `notExistsFile.txt': No such file or directory"
is "cp command" have any option such that if file doesn not exits it wont give any error , it just skip it.
i am performing this from shell script
Upvotes: 0
Views: 1326
Reputation: 3819
You can always redirect the standard error to /dev/null
cp notExistsFile.txt ~/Desktop/ 2>/dev/null
Upvotes: 2