For example, if I create a dustbin folder and it has ~/dustbin/File01 already in it, how would I copy a new file into the folder with the same name?
E.g.:
cp ~/test/File01 ~/dustbin/File01
But add perhaps (Copy) to the end of it
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unix filesystems don’t allow two files with the same name in the same folder (for reference, VMS did allow that).
You can use
catwith append:This creates the file when it doesn’t exist or appends to an existing file.
Also the
cpcommand offers options to make backups so it doesn’t overwrite existing files. See the--backupoption for that.