hi
can i know how to locate a file in a directory by using the "find" command? i want to know the exact path the files reside in in the result.
thanks :confused: (4 Replies)
I need to find all the files with a given file name present in the sub directories and execute a script on each file
For example In the directory source , I need to find all the files named test and execute the script run.sh
Can anyone please help me on this (4 Replies)
I am trying to determine the oldest and most recent files in a huge directory. I am using an ls -tr statement outside my find statement. The directory is too big and I am getting an "arg list too long" error. Is there something I can put in my find statement that doesn't create a list to... (2 Replies)
I have a folder that has new files created everyday, is there a way i can filter them so that only the 5 newest files are displayed? I'm hoping this can be done by a one liner without a script.
for example my directory contains
-rw-r--r-- 1 root root 0 Jun 24 08:34 file112
-rw-r--r-- 1 root... (2 Replies)
Hi,
I need help in writing shell script to accomplish the following.
1.I've one text file which contains list of batch numbers like b1.dat,b2.dat,b3.dat...
2.I've the same files along with other files present in some directory.i.e 1.dat,2.dat,3.dat,4.dat,5.dat... present in some directory.... (3 Replies)
Hi
I think this should be relatively simple but I can't figure it out. I have several files with the same name in different folders within a directory (the output of a program that I ran). Something like this:
./myAnalysis/item1/round1/myoutput.txt
./myAnalysis/item1/round2/myoutput.txt... (2 Replies)
I have a unique situation, I have a RHEL OS but also a file path that has a OS image (it is not the image running on the machine) if I run fire fox -version it will give me the version of the actively installed FF however I need to know if the version of FF sitting in the non active path is the... (4 Replies)
Hi,
Is there a way to find out the size of a sub-directory?
Eg subidrectory in main directory /data, like this : /data/solr-5.3.1.
When I do a df -h /data/solr-5.3.1, it still gives the size of /data:
root@L28condor:/data/solr-5.3.1# df -h .
Filesystem Size Used... (1 Reply)
I need to find the latest file -filename_YYYYMMDD in the directory DIR. the below is not working as the position is shifting each time because of the spaces between(occuring mostly at file size field as it differs every time.)
please suggest if there is other way.
report =‘ls -ltr... (2 Replies)
Discussion started by: archana25
2 Replies
LEARN ABOUT LINUX
rmdir
RMDIR(2) Linux Programmer's Manual RMDIR(2)NAME
rmdir - delete a directory
SYNOPSIS
#include <unistd.h>
int rmdir(const char *pathname);
DESCRIPTION
rmdir() deletes a directory, which must be empty.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EACCES Write access to the directory containing pathname was not allowed, or one of the directories in the path prefix of pathname did not
allow search permission. (See also path_resolution(7).
EBUSY pathname is currently in use by the system or some process that prevents its removal. On Linux this means pathname is currently
used as a mount point or is the root directory of the calling process.
EFAULT pathname points outside your accessible address space.
EINVAL pathname has . as last component.
ELOOP Too many symbolic links were encountered in resolving pathname.
ENAMETOOLONG
pathname was too long.
ENOENT A directory component in pathname does not exist or is a dangling symbolic link.
ENOMEM Insufficient kernel memory was available.
ENOTDIR
pathname, or a component used as a directory in pathname, is not, in fact, a directory.
ENOTEMPTY
pathname contains entries other than . and .. ; or, pathname has .. as its final component. POSIX.1-2001 also allows EEXIST for
this condition.
EPERM The directory containing pathname has the sticky bit (S_ISVTX) set and the process's effective user ID is neither the user ID of the
file to be deleted nor that of the directory containing it, and the process is not privileged (Linux: does not have the CAP_FOWNER
capability).
EPERM The file system containing pathname does not support the removal of directories.
EROFS pathname refers to a directory on a read-only file system.
CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
BUGS
Infelicities in the protocol underlying NFS can cause the unexpected disappearance of directories which are still being used.
SEE ALSO rm(1), rmdir(1), chdir(2), chmod(2), mkdir(2), rename(2), unlink(2), unlinkat(2)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/.
Linux 2008-05-08 RMDIR(2)