Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

remove(3) [freebsd man page]

REMOVE(3)						   BSD Library Functions Manual 						 REMOVE(3)

remove -- remove directory entry LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdio.h> int remove(const char *path); DESCRIPTION
The remove() function removes the file or directory specified by path. If path specifies a directory, remove(path) is the equivalent of rmdir(path). Otherwise, it is the equivalent of unlink(path). RETURN VALUES
The remove() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The remove() function may fail and set errno for any of the errors specified for the routines lstat(2), rmdir(2) or unlink(2). SEE ALSO
rmdir(2), unlink(2) STANDARDS
The remove() function conforms to ISO/IEC 9899:1990 (``ISO C90'') and X/Open Portability Guide Issue 4, Version 2 (``XPG4.2''). BSD
June 4, 1993 BSD

Check Out this Related Man Page

remove(3C)						   Standard C Library Functions 						remove(3C)

remove - remove file SYNOPSIS
#include <stdio.h> int remove(const char *path); DESCRIPTION
The remove() function causes the file or empty directory whose name is the string pointed to by path to be no longer accessible by that name. A subsequent attempt to open that file using that name will fail, unless the file is created anew. For files, remove() is identical to unlink(). For directories, remove() is identical to rmdir(). See rmdir(2) and unlink(2) for a detailed list of failure conditions. RETURN VALUES
Upon successful completion, remove() returns 0. Otherwise, it returns -1 and sets errno to indicate an error. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
rmdir(2), unlink(2), attributes(5), standards(5) SunOS 5.11 14 Aug 2002 remove(3C)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers


why is 'cd' a shell built in and not an executable? (27 Replies)
Discussion started by: clickonline1
27 Replies

2. Post Here to Contact Site Administrators and Moderators

Our First Flash Intro ?

Well, someone created a flash intro for us (their first attempt at SWiSH!) OK, SECOND DRAFT: --------------------------- FIRST DRAFT: Notice it says "Search before posting a question"..... Well????... (24 Replies)
Discussion started by: Neo
24 Replies

3. Shell Programming and Scripting

Remove unwanted data?

Hi Can any one help me remove the unwanted data? I would want to remove the complete event id 4910 ( the type there is INFO), that means, I have to remove starting from 7th - 19th lines. can any one of you please help? Thanks, (24 Replies)
Discussion started by: hitmansilentass
24 Replies

4. UNIX for Dummies Questions & Answers

Copy all the files with time stamp and remove header,trailer from file

All, I am new to unix and i have the following requirement. I have file(s) landing into input directory with timestamp, first i want to copy all these files into seperate directory then i want to rename these files without timestamp and also remove header,trailer from that file.. Could... (35 Replies)
Discussion started by: ksrams
35 Replies

5. Shell Programming and Scripting

remove files other than selected

I wanna remove a set files other than some selected files. Eg. :rolleyes::rolleyes::rolleyes: a directory contains n files like test1.dat test2.dat test3.dat test4.dat out5.dat out1.dat i wanna remove all files which doesnot name like *test* I want to use this in shell... (22 Replies)
Discussion started by: freakygs
22 Replies

6. Shell Programming and Scripting

Unix Remove repetitive alphabets

Hi, I am trying to write a script that will take 2 or more instances of repetitive alphabets (ZZ) to be removed from a field. This should only happen from beginning and end of a field. For Example : Input File a) ZZZIBM Corporation b) ZZZIBM Corporation ZZZZZ b) IBM ZZZ... (26 Replies)
Discussion started by: msalam65
26 Replies

7. Shell Programming and Scripting

sed to remove

Hello I have a file with records...The records have several lines and have start and end born... This is a template: 000000001 LDR L ^^^^^nam^^2200325Iia^45e0 000000001 022 L $$a0081-3397 000000001 041 L $$aSPA 000000001 088 L $$aJ.E.N. 551 000000001 090 L $$aINFORMES JEN... (22 Replies)
Discussion started by: ldiaz2106
22 Replies

8. UNIX for Dummies Questions & Answers

How do I remove commands?

I would like to remove rsh, rcp, rlogin from my production server. How would i go about it? Should i remove them from their original location using rm? Will that impact on any other functionality? ---------- Post updated at 12:39 AM ---------- Previous update was at 12:16 AM ---------- ... (23 Replies)
Discussion started by: pinga123
23 Replies

9. Shell Programming and Scripting

Want to remove the last characters from each row of csv using shell script

Hi, I've a csv file seperated by '|' from which I'm trying to remove the excess '|' characters more than the existing fields. My CSV looks like as below. HRLOAD|Service|AddChange|EN PERSONID|STATUS|LASTNAME|FIRSTNAME|ITDCLIENTUSERID|ADDRESSLINE1 10000001|ACTIVE|Testazar1|Testore1|20041|||... (24 Replies)
Discussion started by:
24 Replies

10. Shell Programming and Scripting

Remove duplicate line on condition

Hi Ive been scratching over this for some time with no solution. I have a file like this 1 bla bla 1 2 bla bla 2 4 bla bla 3 5 bla bla 1 6 bla bla 1 I want to remove consecutive occurrences of lines like bla bla 1, but the first column may be different. Any ideasss?? (23 Replies)
Discussion started by: jamie_123
23 Replies

11. Shell Programming and Scripting

How to remove the last 3 lines from many files?

Hello, I need to run a command or shell script that will remove the last 3 lines from every .js file that is under the directory /var/ww/vhost/ Can you please help ? thank you. (22 Replies)
Discussion started by: MaRiOsGR
22 Replies

12. UNIX for Dummies Questions & Answers

Want to remove all lines but not latest 50 lines from a file

Hi, I have a huge file which has Lacs of lines. File system got full. I want your guys help to suggest me a solution so that I can remove all lines from that file but not last 50,000 lines. I want solution which can remove lines from existing file so that I can have some space left with. (28 Replies)
Discussion started by: prashant2507198
28 Replies

13. UNIX for Dummies Questions & Answers

Remove newlines

Hi buddy's my file are like this:,name,band,sal 1,"suneel",,10 2,"bargav sand",,20 30," ebdug gil",,4 but i want,name,band,sal 1,"suneel",,10 2,"bargav sand",,20 30,"ebdug gil",,4 any command or Shell script for this. please help me it's urgent to implement (33 Replies)
Discussion started by: Suneelbabu.etl
33 Replies

14. Shell Programming and Scripting

awk remove/grab lines from file with pattern from other file

Sorry for the weird title but i have the following problem. We have several files which have between 10000 and about 500000 lines in them. From these files we want to remove lines which contain a pattern which is located in another file (around 20000 lines, all EAN codes). We also want to get... (28 Replies)
Discussion started by: SDohmen
28 Replies

15. OS X (Apple)

Undeletable file

Greetings, I'm trying to delete a file with a weird name from within Terminal on a Mac. It's a very old file (1992) with null characters in the name: ␀␀Word Finder® Plus™. Here are some examples of what I've tried: 12FX009:5 dpontius$ ls ␀␀Word Finder® Plus™ 12FX009:5 dpontius$ rm... (29 Replies)
Discussion started by: dpontius
29 Replies