Sponsored Content
Full Discussion: Directory can't remove!
Operating Systems HP-UX Directory can't remove! Post 302878446 by vbe on Friday 6th of December 2013 07:29:47 AM
Old 12-06-2013
using just rm -rf...
But my concern is more I never saw a message that is untrue when it comes to a directory, so what is it? If its a mounting point and you remved lost+found, you are looking for trouble... But if it is try to umount it, it will tell you if it can, in your case it should not be able... which means and explains the not empty, someone removed a file that was still open... so you are to use fuser -cku to kill whatever process his there...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

smitty, remove user, remove directory as well..

hi, i am on aix. i used smitty to remove a user.. but then found that its directory still exists.... so i have to remove the directory manually... am i doing it the right way? (2 Replies)
Discussion started by: yls177
2 Replies

2. Solaris

Can't remove a directory

Hello, somehow a directory called -r was created on one of my servers and I can't remove is using either rm or rmdir. Is there a way to remove this directory? Thank you. -David (2 Replies)
Discussion started by: dkranes
2 Replies

3. Programming

Recursive remove directory.

What is the best way to completely remove dir with it's content ??? rmdir deletes only EMPTY dirs as i know. The man page of remove function says "remove() deletes a name from the file system." Can it remove any dir recursively ??? :rolleyes: (7 Replies)
Discussion started by: Trump
7 Replies

4. Shell Programming and Scripting

remove empty directory

Hi, I need to delete an empty directory in a temp directory except "dir5" (keep everything that is not empty). Plese advise. Here is an example of my directory. /dir/temp/ dir1 - delete if this is empty dir2 - delete if this is empty dir3 - delete if this is empty dir4 - delete if this... (7 Replies)
Discussion started by: sirrtuan
7 Replies

5. Shell Programming and Scripting

Remove contents of directory, but not directory

What's the best way to delete everything in a directory, but not the directory itself, without using shell wildcards? (9 Replies)
Discussion started by: pdc
9 Replies

6. Shell Programming and Scripting

how to remove recursilvely from a directory

I can remove blank lines at end of file using following code for files in `ls * 2>/dev/null` do sed -e :a -e '/^\n*$/N;/\n$/ba' $files > newfile mv newfile $files done How can I change above code, so that it recursively executes that code for all files under a directory? (6 Replies)
Discussion started by: ruchimca
6 Replies

7. UNIX for Advanced & Expert Users

Remove directory with exceptions

Hi, I want to remove a directory recursively except the inside directories calles .SYNC (designsync dirs) I am looking for something like: \rm -rf < find . * | grep -v .SYNC The find works ok but I do not know how to redirect it. Please help. Regards, Ziv:rolleyes: (1 Reply)
Discussion started by: zivsegal
1 Replies

8. Shell Programming and Scripting

Remove directory with exceptions

Hi, I want to remove a directory recursively except the inside directories calles .SYNC (designsync dirs) I am looking for something like: \rm -rf < find . * | grep -v .SYNC The find works ok but I do not know how to redirect it. Please help. Regards, Ziv (3 Replies)
Discussion started by: zivsegal
3 Replies

9. Shell Programming and Scripting

Remove Directory

By Mistake i created a directory named "-lrt" in one of my working directories and now i am not able to delete it , please suggest hw to delete this directory now ? Thanks in advance. (1 Reply)
Discussion started by: neeraj617
1 Replies

10. UNIX for Dummies Questions & Answers

How to remove directory of a particular user?

How to remove directory of a particular user (1 Reply)
Discussion started by: pspriyanka
1 Replies
fuser(8)						      System Manager's Manual							  fuser(8)

NAME
fuser - Lists process IDs of processes that are using one or more files or file structures SYNOPSIS
/usr/sbin/fuser [-cfu] file ... [Tru64 UNIX] The following format shows extensions not included in the XCU specification for this utility: /usr/sbin/fuser [-cdfku] [-h] [-vH] file ... STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: fuser: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. FLAGS
Identifies file as a mount point. In this case, fuser reports on any files that are open in the mounted file system. Report any refer- enced files that have been deleted including the referencing PID and the block count for the file in 512 byte block units. Requests a report only for the specified files. If a specified file is a mount point, fuser reports only on that file, not on any files below it. [Tru64 UNIX] Suppresses column headings in fuser output when used with the -v flag. [Tru64 UNIX] Directs fuser to display information about its command-line options. [Tru64 UNIX] Directs fuser to send a SIGKILL signal to each process. Because this flag spawns a kill operation for each process, the kill messages may not show up immediately. Directs fuser to show the user login name, in parentheses, associated with each process ID. [Tru64 UNIX] Directs fuser to display results in verbose form. PARAMETERS
[Tru64 UNIX] Directs fuser to ignore previous flag settings for the next set of file parameters. The - operand allows you to apply differ- ent flags to different sets of files in the same command line. Specifies the pathname of the file or the mount point of the file system on which fuser reports. DESCRIPTION
The fuser utility writes to standard output the process IDs of processes that are running on the local system and have one or more files or file structures in use. The utility writes to standard error additional information about these resources that indicates how each resource is being used. If file identifies a block special device, fuser lists all processes using any file on that device. This utility does not display information about files for which you do not have the appropriate privileges. For information on many files, root privilege may be required. Furthermore, you must have appropriate privileges to use the -k flag. The utility uses the following format to write the process ID for each process using each file: "%d", process_id The fuser utility writes diagnostic messages to standard error. In addition, the utility writes the following information to standard error: The pathname of each file, immediately followed by a colon. For each process ID written to standard output, one of the following characters: If the process is using the file as its current directory. [Tru64 UNIX] If the process is using a memory-mapped file. [Tru64 UNIX] If the process is using the file as the parent of its current directory. If the process is using the file as its root directory. [Tru64 UNIX] If the process has the file open. [Tru64 UNIX] If the process is using the file as its controlling tty. [Tru64 UNIX] If the process is using the text file as an executable. If you specify the -u flag, characters indicating the use of the file are followed immediately by the user name, in parentheses, that corresponds to the process's real user ID. If the user name cannot be resolved from the process's real user ID, the process's real user ID is written instead of the user name. When standard output and standard error are directed to the same file, the utility intersperses output so that the file appears at the start of each line, followed by the process ID and the characters indicating file use. Then, if the -u option is specified, the utility writes the user name or user ID for each process that is using that file. The utility writes a newline character at the end of output for each file. ENVIRONMENT VARIABLES
The following environment variables affect this utility: Provides a default value for the locale variables that are unset or null. If LANG is unset or null, the corresponding value from the POSIX (C) locale is used. If any of the locale variables contain an invalid setting, the utility behaves as if none of the variables had been set. If set to a non-empty string value, overrides the values of all the other locale variables. Specifies the locale used to interpret sequences of bytes of text data as characters (for example, determines whether arguments contain single-byte or multibyte characters). Specifies the locale that affects the format and contents of diagnostic messages written to standard error. Determines the location of message catalogs for the processing of LC_MESSAGES. NOTES
[Tru64 UNIX] The fuser utility may not report on processes that begin using a file while the utility is running. Furthermore, processes that fuser reports are using a file may have stopped using it while the utility was running. EXAMPLES
The following command lists the process IDs of processes using the /etc/hosts file: fuser /etc/hosts The following command writes to standard output the process IDs of processes that are using the current directory. The command writes to standard error an indication of how those processes are using the directory and the user names associated with those processes. fuser -fu . EXIT VALUES
The fuser utility returns the following exit values: Successful completion. An error occurred. RELATED INFORMATION
Functions: fuser(2), kill(2) delim off fuser(8)
All times are GMT -4. The time now is 09:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy