Solved

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

Posted on 2006-07-02
9
987 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now