I am trying to use the find command to find files in the current directory that meet a certain date criteria.
find . -type -f -mtime +2
However, the above also checks the directories below.
I tried -prune, but that seems to ignore this directory completely.
I read about using -path w/... (5 Replies)
I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem.
so i need to use find command (6 Replies)
Hi All,
I'm trying to use the find command to return matches for a directory and file.
For example, given the following directories:
/one/two/three/file1.txt
/one/three/two/file1.txt
/one/four/two/three/file1.txt
I'm expecting the following to be returned:
... (16 Replies)
i have this find command on my script as:
for i in `find $vdir -name "$vfile" -mtime +$pday`
the problem with this code is that the sub-directories are included on the search. how do i restrict the search to confine only on the current directory and ignore the sub-directories. please advise.... (7 Replies)
I want to look if there is any file inside a specific directory which was modified before 2 days.
I wrote the find command, but the problem is there is one directory and that is a random directory generated by unix, so not sure on how to code for that on the find command.
find... (5 Replies)
Dear All,
I am using find command
find /my_rep/*/RKYPROOF/*/*/WDM/HOME_INT/PWD_DATA -name rk*myguidelines*.pdf -print
The problem i am facing here is find /my_rep/*/
the directory after my_rep could be mice001, mice002 and mice001_PO, mice002_PO
i want to ignore mice***_PO directory... (3 Replies)
This script writes the output files to FILES but I don't want to exclude all directories from ABC_CHQ and LYS_ADV, I want to include one sub directory name process which is under ABC_CHQ and LYS_ADV in the search. Right now its excluding everything from prune directories such as ABC_CHQ, LYS_ADV... (10 Replies)
I was having trouble remembering the linux command to show where bin files are located. I eventually figured it out from googling that it was "which".
How to find command location in Linux?
Since I saw a few other interesting commands like whereis and type it got me curious. Are there any... (5 Replies)
How can i tweak the below find command to exclude directory/s -> "/tmp/logs"
find . -type f \( ! -name "*.log*" ! -name "*.jar*" \) -printNote: -path option/argument does not work with the version of find that i have.
bash-3.2$ uname -a
SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v (7 Replies)
Discussion started by: mohtashims
7 Replies
LEARN ABOUT OSF1
readlink
readlink(2) System Calls Manual readlink(2)NAME
readlink - Reads the value of a symbolic link
SYNOPSIS
#include <unistd.h>
int readlink (
const char *path,
char *buffer,
size_t buf_size);
The following version of the buf_size argument does not conform to current standards and is supported only for backward compatibility:
int buf_size
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
readlink(): XSH5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Specifies the pathname of the destination file or directory. Points to the user's buffer. The buffer should be at least as large as the
buf_size parameter. Specifies the size of the buffer.
DESCRIPTION
The readlink() function places the contents of the symbolic link named by the path parameter in buffer, which has size buf_size.
If the actual length of the symbolic link is greater than buf_size, an error is returned. The length of a symbolic link will not exceed
PATH_MAX.
[Tru64 UNIX] If the actual length of the symbolic link is less than buf_size, the string copied into the buffer is null-terminated.
For a readlink() function to complete successfully, the calling process must have search access to the directory containing the link.
RETURN VALUES
Upon successful completion, the readlink() function returns a count of bytes placed in the buffer (not including any terminating null). If
the readlink() function fails, the buffer is not modified, a value of -1 is returned, and errno is set to indicate the error.
ERRORS
The readlink() function sets errno to the specified values for the following conditions:
Search permission is denied on a component of the path prefix of the path parameter, or read permission is denied on the final component of
the path prefix of the path parameter. The file named by the path parameter is not a symbolic link. An I/O error occurred while reading
from or writing to the file system. Too many symbolic links were encountered in resolving path. The length of the path parameter exceeds
PATH_MAX, or a pathname component is longer than NAME_MAX while {_POSIX_NO_TRUNC} is in effect. The file named by the path parameter does
not exist or the path parameter points to an empty string. A component of the path prefix of the path parameter is not a directory.
[Tru64 UNIX] The pathname in the symbolic link is longer than buf_size.
For NFS file access, if the readlink() function fails, errno may also be set to one of the following values: [Tru64 UNIX] The owner or
group ID is not a value supported by this implementation. [Tru64 UNIX] Indicates a stale NFS file handle. An opened file was deleted by
the server or another client; a client cannot open a file because the server has unmounted or unexported the remote directory; or the
directory that contains an opened file was either unmounted or unexported by the server.
RELATED INFORMATION
Functions: link(2), stat(2), symlink(2), unlink(2)
Standards: standards(5) delim off
readlink(2)