I must really be bad at life today, because I couldn't even find a search option on the forums before asking for help, so I apologize if this is already listed somewhere.
I'm pretty new to UNIX, and basically only know enough to be dangerous. I have been appointed a task to basically go to a... (2 Replies)
Hi
When trying to find and delete files which are, say, 1 day, the find command misses a day. Please refer the following example.
xxxd$ find . -type f -ctime +1 -exec ls -ltr {} \;
total 64
-rw-rw-r-- 1 oracle xxxd 81 Apr 30 11:25 ./ful_cfg_tmp_20080429_7.dat
-rw-rw-r-- 1... (4 Replies)
Hi
I have a script to find and delete the files which are say, noDaysOld, I am interested to find the number of such files I am fniding for deleting and then deleting it.
So, the script I wrote, first finds the number of such files and then deletes, clearly this is two different steps.
... (3 Replies)
Hi,
I have research data, which is organized to 100 folders numbered 00-99. I have many sets of 100 folders, for different values of initial parameters. For some reason, the computer that ran the program to gather the data, didn't always create a unique seed for each folder. I anticipated that... (1 Reply)
I have a small script where I want to see if a file exists & then delete the first line from it.
I have code to help me find if the file exists, but I am unsure as to how to then take in the answer and remove the first line from the flatfile:
This is what I have so far just to output if the... (3 Replies)
HI All, I need to search for a particular pattern input by the user in order to delete the line. My username.txt has
username@email.com:John:149.0.3.4:1
username1@email.com:Harry:149.0.3.4:1
username1@email.net:Alex:149.0.3.4:1
username1@email.edu:Nemo:149.0.3.4:1
The program i written
... (3 Replies)
In folder there are files
(eg ABS_18APR2012_XYZ.csv
DSE_17APR2012_ABE.csv) .
My requirement is to delete all the files except today's timestamp
I tried doing this to list all the files not having today's date timestamp
#!/bin/ksh
DATE=`date +"%d%h%Y"`
DIR=/data/rfs/... (9 Replies)
Hi,
I have a tab delimited text file where I want to delete all rows that have the same string for column 1. How do I go about doing that? Thanks!
Example Input:
aa 1
aa 2
aa 3
bb 4
bc 5
bb 6
cd 8
Output:
bc 5
cd 8 (4 Replies)
Hi
I have a file:
r58778.3|SOURCES={KEY=f665931a...,fw,221-705}|ERRORS={16_1:T,30_1:T,56_1:C,57_1:T,59_1:A,101_1:A,115:-,158_1:C,186_1:A,204:-,271_1:T,305:-,350_1:C,368_1:G,442_1:C,472_1:G,477_1:A}|SOURCE_1="Contig_1092402550638"(f665931a359e36cea0976db191ff60ff09cc816e)
I want to retain... (15 Replies)
not getting anywhere with this
an xml file contains multiple clients set up with same tags, different values.
I need to parse the file for client foo, and change the value of tag "64bit" from false to true.
cat clients.xml
<Client type"FIX">
<ClientName>foo</ClientName>... (3 Replies)
Discussion started by: jack.bauer
3 Replies
LEARN ABOUT LINUX
revoke
REVOKE(2) BSD System Calls Manual REVOKE(2)NAME
revoke -- revoke file access
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
int
revoke(const char *path);
DESCRIPTION
The revoke() system call invalidates all current open file descriptors in the system for the file named by path. Subsequent operations on
any such descriptors fail, with the exceptions that a read() from a character device file which has been revoked returns a count of zero (end
of file), and a close() system call will succeed. If the file is a special file for a device which is open, the device close function is
called as if all open references to the file had been closed.
Access to a file may be revoked only by its owner or the super user. The revoke() system call is currently supported only for block and
character special device files. It is normally used to prepare a terminal device for a new login session, preventing any access by a previ-
ous user of the terminal.
RETURN VALUES
The revoke() 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
Access to the named file is revoked unless one of the following:
[ENOTDIR] A component of the path prefix is not a directory.
[ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an entire path name exceeded 1024 characters.
[ENOENT] The named file or a component of the path name does not exist.
[EACCES] Search permission is denied for a component of the path prefix.
[ELOOP] Too many symbolic links were encountered in translating the pathname.
[EFAULT] The path argument points outside the process's allocated address space.
[EINVAL] The implementation does not support the revoke() operation on the named file.
[EPERM] The caller is neither the owner of the file nor the super user.
SEE ALSO close(2), revoke(1)HISTORY
The revoke() system call first appeared in 4.3BSD-Reno.
BSD June 4, 1993 BSD