Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie

Status
Not open for further replies.

Chmex21

Technical User
Jun 10, 2001
26
0
0
US
Quick question, how do you delete a dir in Red Hat 7.1 that already has other things inside that dir. Basically trying to delete a full dir.

Thanks
 
'rm -r dirname' will recursively delete the directory. Be very, very careful with this, many people have accidentially deleted an important directory in the process...

Take a look at 'man rm' for more information.

Hope this helps,
Paul
 
Hi,

You may need to do 'rm -rf directoryname' . The -f flag forces removal of write-protected files without prompting. As said above be very careful and make sure you are in the correct parent directory ('pwd' if your prompt doesn't show current directory) or use the full path - especially if you are root.

Rgds

 
Additionally, if there are not too many files, use rm -ri to have rm interactively prompt to confirm removal of each file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top