Solved

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

Posted on 2006-07-02
9
1,006 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

726 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