LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-17-2012, 12:08 AM   #1
harishisnow
LQ Newbie
 
Registered: Nov 2010
Location: bangalore, india
Posts: 17

Rep: Reputation: 0
Forceful removal of directory not working..!!


Hello,

I am trying to delete a directory forcefully and hence I used the command:
rm -rf <dir-name>

Even then, it is asking for confirmation which would prevent me from automating this command.
Please help me with a solution.

scenario:

bash-3.00$ chmod 777 gcc-3.4.2
bash-3.00$
bash-3.00$
bash-3.00$
bash-3.00$ rm -rf gcc-3.4.2/
rm: examine files in directory gcc-3.4.2/ (yes/no)? yes
rm: examine files in directory gcc-3.4.2//gcc (yes/no)? yes
rm: examine files in directory gcc-3.4.2//gcc/cp (yes/no)?


Regards,
Harish
 
Old 01-17-2012, 12:13 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,515

Rep: Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892
Are you sure you own the directory and all its files and sub directories?

Try also typing in alias on the command line as it sounds like rm is probably aliased to rm -i.
 
Old 01-17-2012, 12:16 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
What is your rm? type rm will show. It may be aliased to something like rm -i

EDIT: beaten to it by grail!
 
Old 01-17-2012, 02:00 AM   #4
vp0619520
Member
 
Registered: Jan 2012
Posts: 55

Rep: Reputation: Disabled
Try this:
Code:
\rm -rf gcc-3.4.2/
 
Old 01-17-2012, 04:33 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by harishisnow View Post
Hello,

I am trying to delete a directory forcefully and hence I used the command:
rm -rf <dir-name>

Even then, it is asking for confirmation which would prevent me from automating this command.
Please help me with a solution.

scenario:

bash-3.00$ chmod 777 gcc-3.4.2
bash-3.00$
bash-3.00$
bash-3.00$
bash-3.00$ rm -rf gcc-3.4.2/
rm: examine files in directory gcc-3.4.2/ (yes/no)? yes
rm: examine files in directory gcc-3.4.2//gcc (yes/no)? yes
rm: examine files in directory gcc-3.4.2//gcc/cp (yes/no)?


Regards,
Harish
have you tried this
Code:
#rm -rf gcc-3.4.2/*
 
Old 01-18-2012, 12:23 AM   #6
harishisnow
LQ Newbie
 
Registered: Nov 2010
Location: bangalore, india
Posts: 17

Original Poster
Rep: Reputation: 0
the rm was aliased as rm -i, hence the issue. Its working now.

Thank you for your response.. :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Files are in the working directory michael mc hugh Linux - Newbie 2 10-13-2010 12:32 AM
Directory shares not working billybobt Linux - Newbie 1 09-15-2009 06:31 PM
About current working directory George2 Programming 5 05-02-2007 09:47 PM
suse 9.0 working directory snakedriver Linux - Newbie 1 03-25-2004 07:52 AM
Forceful copy andy18 Linux - General 1 11-05-2002 03:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration