Can someone please help me with a possible case of accidental deletion on a linux box?I ran the following command:cp file1 /newdir1/folder1What I intended to do was to copy file1 to the pre-existing /newdir1/folder1/ directory. Now when I try to go to /newdir1 and run ls command i see folder1 which as a file with contents from file1, instead of finding the original folder1. Folder1 had some files within as well. I didn't get a warning when i ran the copy command. Is it possible that folder1 is now deleted? Is there any way to check for it or Is there any way to recover it if it is deleted?This is what I have checked so far: When i type alias cp i get alias cp='cp -i' To check linux version, I browsed to the /etc/ directory and checked redhat-release file and it says CentOS release 6.4 (Final) Thanks
Is it possible to overwrite a directory with a file in linux
linux;directory;cp
If the folder1 item is actually the file1 file, then there was no preexisting folder1 directory. The default behavior of cp is that if the destination is a directory, the item(s) to be copied will be copied into the destination directory. Note that in Linux, folder1 and Folder1 are different, as it is case-sensitive.