Hi

Is this a interview question ?

If you are a experienced person in IT before deleting anything you would always backup.

Comming back to your question if you use rman its very simple command because rman persists lot of meta data about its backup in the oracle database using controlfile or catalog.

If you are doing usermanaged backups then you would need to implement the same logic that rman does using shell scripts.

regards