Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I accidently created a folder which has the same name of a folder which was already existing in the same parent directory. i want to delete the newly created directory. is ther a way to identify the new directory based on a unique id or is ther a way delete all the folders whcih was created after a particular timestamp? The original directory should be untouched. Any workaround for this?

Thanks Prasun

share|improve this question

migrated from stackoverflow.com Feb 6 '13 at 15:05

This question came from our site for professional and enthusiast programmers.

3  
Do you have a directory containing two subdirectories of the same name? That should not be possible. –  Joachim Pileborg Feb 6 '13 at 12:09
    
Hi all, Thanks for ur time. The main issue was while creating the new directory an extra ** character was appended to the folder name (dunno how) and while doin an ls these characters were not displaying. Hence it lokked like i've folders with the same name. I chceked the same folder using filezilla and found out that the folder name was different. Copied the folder name and pasted back into unix while deleteing the folder and it was successful. joachim Pileborg: yes u are right, even i was puzzled and find command will be useful some day thanks :). David Water: Thanks for the info :) Prasun –  user1196851 Feb 6 '13 at 12:55

1 Answer 1

To find files created after a specific date, you could use the find command:

$ find . -type d -ctime -1

The above command will find all directories (-type d) changed since yesterday (-ctime -1).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.