HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Removing files recursively
Operating System - HP-UX
1827487
Members
2168
Online
109965
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 12:24 AM
05-12-2002 12:24 AM
Hi,
I tried removing a filesystem i.e nwd.256k.cr.2 by using:
rm -r nwd.srtl.cr
The annoying thing is it produces the following prompt, for each directories under this filesystem:
rm: remove write protected file nwd.256k.cr.2/v0_archive/central_inputs ?
Note that the filesystem nwd.256k.cr.2 has the following permission mode:
drwxr-xr-x usr1 nwd.256k.cr.2
How do I actually write a script to remove these sorts of filesystem recursively, without having to answer these prompts?
Thanks.
I tried removing a filesystem i.e nwd.256k.cr.2 by using:
rm -r nwd.srtl.cr
The annoying thing is it produces the following prompt, for each directories under this filesystem:
rm: remove write protected file nwd.256k.cr.2/v0_archive/central_inputs ?
Note that the filesystem nwd.256k.cr.2 has the following permission mode:
drwxr-xr-x usr1 nwd.256k.cr.2
How do I actually write a script to remove these sorts of filesystem recursively, without having to answer these prompts?
Thanks.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 12:37 AM
05-12-2002 12:37 AM
Solution
Hello,
It is a good practice where the system prompts for removing a file.
I assume you are working on c shell.
There is a alias set on your profile for rm command as rm -i
So to remove the directory without being interactive
just use
$unalias rm
$rm -r
else you can use the force option.
$rm -rf
You should be usr1 user to delete your directory
It is a good practice where the system prompts for removing a file.
I assume you are working on c shell.
There is a alias set on your profile for rm command as rm -i
So to remove the directory without being interactive
just use
$unalias rm
$rm -r
else you can use the force option.
$rm -rf
You should be usr1 user to delete your directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 12:37 AM
05-12-2002 12:37 AM
Re: Removing files recursively
Hi Chern
If a user does not have write permission for a file to be removed and
standard input is a terminal, a prompt containing the file name and
its permissions is printed requesting that the removal of the file be
confirmed (see Access Control Lists below). A line is then read from
standard input. If that line begins with y the file is deleted;
otherwise, the file remains. No questions are asked when the -f
option is given or if standard input is not a terminal.
If file is of type directory, and the -f option is not specified, and
either the permissions of file do not permit writing and standard
input is a terminal or the -i option is specified, rm writes a prompt
to standard error and reads a line from standard input. If the
response does not begin with y, it does nothing more with the current
file and goes on to any remaining files.
Also
Use the -exec command to perform actions after a command ,ie
find . -size +10000000c -exec ll {} \; | more
Hope this helps
Steve
If a user does not have write permission for a file to be removed and
standard input is a terminal, a prompt containing the file name and
its permissions is printed requesting that the removal of the file be
confirmed (see Access Control Lists below). A line is then read from
standard input. If that line begins with y the file is deleted;
otherwise, the file remains. No questions are asked when the -f
option is given or if standard input is not a terminal.
If file is of type directory, and the -f option is not specified, and
either the permissions of file do not permit writing and standard
input is a terminal or the -i option is specified, rm writes a prompt
to standard error and reads a line from standard input. If the
response does not begin with y, it does nothing more with the current
file and goes on to any remaining files.
Also
Use the -exec command to perform actions after a command ,ie
find . -size +10000000c -exec ll {} \; | more
Hope this helps
Steve
take your time and think things through
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 12:47 AM
05-12-2002 12:47 AM
Re: Removing files recursively
TG,
I used the rm -rf, and it worked!
Thanks.
I used the rm -rf
Thanks.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP