-1

I want to delete one of two folders which is having exactly same name but containing different files in it. How can i delete specific folder from these two in terminal ?

  • 3
    What? You can't have two subdirectories in a directory with exactly the same name... – Richard Sep 17 '13 at 17:23
  • The two directories (folders) must have either a different name or different path (location). You would use the proper name or proper path with the rm command rm -rfi /path/to/directory , careful with the rm command, if you use the wrong location you will loose data. – Panther Sep 17 '13 at 17:26
  • @searchfgold6789 I have this situation in a directory. It happens due to copying a directory(of same name) by scp command from remote. – Durgesh Suthar Sep 17 '13 at 17:29
  • 1
    Are you sure there is no whitespace at the end of one of the names and the case of all characters is the same? – soulsource Sep 17 '13 at 17:33
  • 1
    @DurgeshSuthar Can you post the output on paste.ubuntu.com? Copy exactly as it is from terminal. – Radu Rădeanu Sep 17 '13 at 17:44
0

I have solved this issue by a different way. Like someone have two folders of same name as sub in a directory dir
First I renamed one of directory ( I don't know which). Then checked the directory got renamed by seeing contents of it.

mv dir/sub dir/sub1

And then deleted the directory which is not required ( live sub1 is not required)

rm -r dir/sub1

Not the answer you're looking for? Browse other questions tagged or ask your own question.