REMOVE(3) Linux Programmer's Manual REMOVE(3)NAME
remove - remove a file or directory
SYNOPSIS
#include <stdio.h>
int remove(const char *pathname);
DESCRIPTION
remove() deletes a name from the file system. It calls unlink(2) for files, and rmdir(2) for directories.
If the removed name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made
available for reuse.
If the name was the last link to a file, but any processes still have the file open, the file will remain in existence until the last file
descriptor referring to it is closed.
If the name referred to a symbolic link, the link is removed.
If the name referred to a socket, FIFO, or device, the name is removed, but processes which have the object open may continue to use it.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
The errors that occur are those for unlink(2) and rmdir(2).
CONFORMING TO
C89, C99, 4.3BSD, POSIX.1-2001.
NOTES
Under libc4 and libc5, remove() was an alias for unlink(2) (and hence would not remove directories).
BUGS
Infelicities in the protocol underlying NFS can cause the unexpected disappearance of files which are still being used.
SEE ALSO rm(1), unlink(1), link(2), mknod(2), open(2), rename(2), rmdir(2), unlink(2), mkfifo(3), symlink(7)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2008-12-03 REMOVE(3)
Check Out this Related Man Page
REMOVE(3) Linux Programmer's Manual REMOVE(3)NAME
remove - remove a file or directory
SYNOPSIS
#include <stdio.h>
int remove(const char *pathname);
DESCRIPTION
remove() deletes a name from the filesystem. It calls unlink(2) for files, and rmdir(2) for directories.
If the removed name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made
available for reuse.
If the name was the last link to a file, but any processes still have the file open, the file will remain in existence until the last file
descriptor referring to it is closed.
If the name referred to a symbolic link, the link is removed.
If the name referred to a socket, FIFO, or device, the name is removed, but processes which have the object open may continue to use it.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
The errors that occur are those for unlink(2) and rmdir(2).
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+----------+---------------+---------+
|Interface | Attribute | Value |
+----------+---------------+---------+
|remove() | Thread safety | MT-Safe |
+----------+---------------+---------+
CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C89, C99, 4.3BSD.
BUGS
Infelicities in the protocol underlying NFS can cause the unexpected disappearance of files which are still being used.
SEE ALSO rm(1), unlink(1), link(2), mknod(2), open(2), rename(2), rmdir(2), unlink(2), mkfifo(3), symlink(7)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU 2017-09-15 REMOVE(3)
hi all,
I have a newbie question. I don't seem to find a program that simulate ADD/REMOVE program on WINxx. Is there any rule or typical way of how application is removed?
Thanks in advance. (1 Reply)
I wish to remove a user from the system... but an error occurr...
I try to remove via SMITTY and try to remove via command line with
rmuser -p (name of user)
and does not works.... The system display that the "Name is too long"
There another way to remove a user... or... (1 Reply)
Hi,
I saw this C program on Unix with
unlink("tmp.log");
unlink("time.log");
at the end of the file.
What's the purpose of doing this?
Thanks a lot! (1 Reply)
Discussion started by: whatisthis
1 Replies
4. Post Here to Contact Site Administrators and Moderators
Hello,
I am aware of that Find command finds certain files and remove command removes certain files.
However, is there a way to Find certain DIRECTORY and remove that DIRECTORY?
thank you (3 Replies)
Hi
I have a script to remove log files when it reaches %70 usage in order to descending order of dates. But sometimes it happens to remove open - being processes files , so makes them unlinked from the directors and results them disappeared.
How can I solve this problem , simple scenario I... (9 Replies)
I was trying to remove a symbolic link of /etc/hosts to /etc/inet/hosts
well i forgot the command and in the /etc directory i did unlink inet and now i can not get into inet and it does not exist in /etc
1) what do i do to fix the inet directory
2) how do i link /etc/hosts to... (1 Reply)
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)
Hi,
I have some files with some extension e.g. abc.xml.REMOVE,xyz.xml,efg.xml.REMOVE .
I have to remove the .REMOVE extension. I can display it using the below script but cannot rename it.
ls -l|sed 's/\.REMOVE//'
How can I rename this?
Thanks in advance (7 Replies)
Hello all,
I've been asked to help with some cleanup on a couple of systems that were running some Websphere apps. I need to remove the following filesets:
mqsi61.cfgmgrc 6.1.0.2 COMMITTED Config. Manager Component
mqsi61.cfgmgrf 6.1.0.2 COMMITTED Config.... (4 Replies)
I wish to unlink multiple links, but man pages shows
unlink - call the unlink function to remove the specified file
let's linked are in number sequence and I'm doing
unlink `echo {1..500}`
This fails..
Is their any other command to execute it or I need to call the unlink function that... (1 Reply)
Discussion started by: posix
1 Replies
14. Post Here to Contact Site Administrators and Moderators
Hi Sir,
There is an escalation going on this and could you please remove the words from the following link .
this is really critical.
https://www.unix.com/shell-programming-and-scripting/196647-remove-headings.html
please remove following terms
fiappl17dev
fiappl18dev ... (1 Reply)