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

Posted on 2007-08-07
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

    As root, you just do

    rm -r /path/to/dir
    LVL 14

    Expert Comment

    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


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. Please see for the updated article. It is avail…
    In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
    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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    734 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

    20 Experts available now in Live!

    Get 1:1 Help Now