• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1022
  • Last Modified:

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

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
chaitu chaitu
Asked:
chaitu chaitu
  • 5
  • 3
2 Solutions
 
Jon_FergusonCommented:
rm -rdf /path/to/folder

man rm
0
 
chaitu chaituAuthor Commented:
what is "man rm"???
0
 
pjedmondCommented:
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
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
pjedmondCommented:
...or

rm -Rf /path/to/folder

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

(   (()
(`-' _\
 ''  ''
0
 
chaitu chaituAuthor Commented:
this command is enough

rm -rdf /root/org/apache/jsp
0
 
pjedmondCommented:
or

rm -Rf /root/org/apache/jsp

if you want to use 1 less letter:)

(   (()
(`-' _\
 ''  ''
0
 
chaitu chaituAuthor Commented:
in this directory /root/org/apache/jsp if i want to delete only class files then

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

0
 
pjedmondCommented:
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
 
pjedmondCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now