- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- deleting a file
Categories
Company
Local Language
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
Forums
Discussions
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
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО04-30-2006 07:38 AM
тАО04-30-2006 07:38 AM
There is a file named -p got created in my home directory and filling out the space.
I found inode of the -p file by using ll -li command and used rm -i inode number but file didn't get deleted.
Can someone let me know how this file might have got created and how to delete it ?
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 07:46 AM
тАО04-30-2006 07:46 AM
Re: deleting a file
Try rm ?p pr rm *p, generally rm will ask you permission.
better use mv ?p to /tmp and do your rm
Care : do not try rm -f. This will not ask your permission.
This could have got created by mistake like if you see the keyboard "-" and "p" are just upon one another.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 07:53 AM
тАО04-30-2006 07:53 AM
Re: deleting a file
Awadhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 07:54 AM
тАО04-30-2006 07:54 AM
Re: deleting a file
Awadhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 09:07 AM
тАО04-30-2006 09:07 AM
SolutionI had the same thing happen to me last week.
I finally ended up moving all the good files out of the directory and wiping out the parent folder.
I tried quotes. I tried -f, nothing helped.
Surely my solution was only because I was too busy to find a real solution.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 09:09 AM
тАО04-30-2006 09:09 AM
Re: deleting a file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 09:30 AM
тАО04-30-2006 09:30 AM
Re: deleting a file
If you are not root when you attempt to remove the file, do you own the file? If not, remove it as the root user.
Does an 'ls -l' show the object to be a *file* or is it a *directory*. If its a directory, you need to remove it with 'rmdir' or use 'rm -r' to remove the directory's contents and then the directory.
Are you sure that you have the correct inode number when you issue the 'rm'? Using 'find /path -xdev -inum
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 09:44 AM
тАО04-30-2006 09:44 AM
Re: deleting a file
I used the command as below and got the below error message:-
# find /home/sksonkar/ -xdev -inum 750 -exec rm {} \;
vxfs: mesg 001: vx_nospace - /dev/vg00/lvol4 file system ful (1 blok extent)
#
After few minutes i checked the file having
-p name and it got vanished.
Anyway, seems it worked.
It was a big file and was growing by itself though. I was hoping that after deleting this file will free some disk space but it didn't free up the space.
Thanks a lot.
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 10:14 AM
тАО04-30-2006 10:14 AM
Re: deleting a file
If you still have a process that is/was writing to the file, then the file will not be truly removed until the last process using the file terminates.
It is a common practice in Unix programming to open a temporary file and immediately 'unlink' it. (the 'unlink'(2) system call is what 'rm' actually uses). WHen this is done, the visible directory entry ceases to exist, but the file is available to the process that created it for the duration of that process's life. When the last process using the file terminates, the inode is marked free and any space allocated to the file is returned to the filesystem.
Thus, while your file appears to have vanished, as long as any process is using it, the space the file has consumed will continue to be allocated from the filesystem in which it lives!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2006 08:05 PM
тАО04-30-2006 08:05 PM
Re: deleting a file
This is a common mistake/problem.
Usually while deleting files you can check
fuser -u filename
to check if the file is opened by any process.
Now in this case if you have lsof on your system them you can run lsof to check which files are open and then if possible kill the process which has the deleted file open.
OR
reboot your system.
If you have an idea which user owns/runs the process which may have opened this file, then do
lsof -u userid
or do
lsof +D dirname -x
where dirname is the path where the file was there e.g. /home/sksonkar
Once the process has been identified - you need to kill the process (at appropriate time) to release the space.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2006 02:11 AM
тАО05-01-2006 02:11 AM
Re: deleting a file
rm -- -p
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2006 09:23 PM
тАО05-01-2006 09:23 PM
Re: deleting a file
?ll|grep "\-p"
-rw-r--r-- 1 usr grp 10 May 2 11:16 -p
?ll -i
1186 -rw-r--r-- 1 usr grp 10 May 2 11:16 -p
?find . -inum 1186 -exec ll {} \;
-rw-r--r-- 1 usr grp 10 May 2 11:16 ./-p
?find . -inum 1186 -exec rm {} \;
?ll
ran