Solved

can't i delte folder at one stretch through ssh?

Posted on 2006-07-02
9
998 Views
Last Modified: 2012-06-21
when i delting folder then i am getting below meesage;after deleting sub folders i am able to delete main folder;i am doing through SSH.

"please make sure that the folder is empty before deleting it"

can't i delte folder at one stretch?
0
Comment
Question by:chaitu chaitu
  • 5
  • 3
9 Comments
 
LVL 7

Assisted Solution

by:Jon_Ferguson
Jon_Ferguson earned 200 total points
ID: 17029055
rm -rdf /path/to/folder

man rm
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 17029069
what is "man rm"???
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17029336
man rm

gives you the manual entry for the rm (remove command)

man man

gives you the manual entry for the man command. A manual entry exists for most linux command and is a valuable reference on any linux system.

(   (()
(`-' _\
 ''  ''
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 22

Accepted Solution

by:
pjedmond earned 300 total points
ID: 17029354
...or

rm -Rf /path/to/folder

recursively deletes any content within a folder and then deletes it.

(   (()
(`-' _\
 ''  ''
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 17029638
this command is enough

rm -rdf /root/org/apache/jsp
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17029652
or

rm -Rf /root/org/apache/jsp

if you want to use 1 less letter:)

(   (()
(`-' _\
 ''  ''
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 17029667
in this directory /root/org/apache/jsp if i want to delete only class files then

rm -Rf /root/org/apache/jsp *.class

0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17029697
rm  /root/org/apache/jsp/*.class

will delete only .class files and it will prompt you for each file to delete (Y/N)

to delete all of the *.class files without prompting:

rm -Rf /root/org/apache/jsp/*.class

(   (()
(`-' _\
 ''  ''

0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17029705
Ooops - recursive not required for this one, so to delete all of the *.class files without prompting:

rm -f /root/org/apache/jsp/*.class

is sufficient:)

(   (()
(`-' _\
 ''  ''

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ignore other .htaccess 2 59
awk to variable in bash 2 76
php56-php-mcrypt for rhel7 php56 1 55
Unix Help with:  mailx -s 17 22
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question