[Last Call] Learn how to a build a cloud-first strategyRegister Now


How to delete a select group of directories on a Solaris 2.5 server?

Posted on 2007-08-07
Medium Priority
Last Modified: 2013-12-27
Whats the command to delete a select group of directories?  I want to delete the parent and all the subdirectories under it.  We're getting rid of an old Solaris server and I need to remove the dirs and files that have data in them.  I want the o/s and standard file systems root, var, etc, left intact.
Question by:mobot
LVL 48

Accepted Solution

Tintin earned 500 total points
ID: 19649970
As root, you just do

rm -r /path/to/dir
LVL 14

Expert Comment

ID: 19658247
What Tintin said will work.

But, if you are surplussing this machine, or otherwise concerned that the data may be accessed by persons outside of your organization, you may want to do a better job of wiping out the disks.

How you do that depends on the actual configuration of your system.

If the data is on a disk separate from the system disk, then you can do a newfs on the disk which will make the data less readable.

Good Luck!

Author Comment

ID: 19666166

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

829 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