Hi,
I'm using the following command to get a list of files on the system.
find /releases -type f -exec ls -l > /home/sebarry/list.txt '{}' \;
however, its searching a directory I don't want it to search so I know I have to use prune but I don't seem to be able to get prune and exec to work... (2 Replies)
I have a directory named https-abcd
Under that I have some directories, files and links.
One of those directories is with name logs and the logs directory has lot of files in it.
I need to tar the whole https-abcd directory excluding the logs directory only, I should get all the links, files and... (2 Replies)
Hi,
I am using a find command like below in my script:
find /outfiles -type f -name cat -o -name vi -o -name grep 2>/dev/null
Which will search for files like "cat" , "vi" or "grep" in the "/outfiles" and subdirectories.
I want to ignore a particular subdirectory from the search. I... (4 Replies)
Hi,
I want to list files only from the current dir and its child dir (not from child's child dir).
i have the following files,
./ABC/1.log
./ABC/2.log
./ABC/ABC1/A.log
./ABC/ABC1/B.log
./ABC/ABC1/XYZ/A1.log
./ABC/ABC1/XYZ/A2.log
Here i want to list only the log file from current... (1 Reply)
OK, I'm trying search and destroy tabs again.
This time I'm having trouble excluding certain directories from my search.
Here is what I have tried and it is not ignoring the top level build directory:
find . -path ./build -prune -name \*.java -o -print | xargs grep -i ' '
I don't... (6 Replies)
Hi,
i try to catch all files in a dir ,without going down in subdir , which don't have file extension and older than 10 days for example:
my dir :
drwxr-xr-x 7 notes01 notes 4096 Mar 8 14:11 .
drwxr-xr-x 116 root system 4096 Mar 9 11:17 ..
-rw-r----- 1 notes01... (4 Replies)
How do I run a find without is looking in ./Trash
gregg@gregg-desktop:/media/Audio$ find . -type f ! -name '*.jpg' -size 1M -print |head
find: `./.Trash-1000/expunged/2781324553/mp3-to-m4b-batch': Input/output error
find:... (0 Replies)
Hi
I am trying to list all files in every subdirectory from a given location. However, I realise that 1 folder will have files that I am not interested in. This is using a .csh file to execute
I have tried different scripts but to no avail. My current incarnation is below. Would someone be... (4 Replies)
I am into
cd /home/work/amey/history-*/
Under amey I have directories
history, history-1, history-2 and under history-2 I have got 2 files 3 and 2.
When I run the find command I get the below o/p.
find /home/work/amey/history-*/. -name . -o -prune -type f
/home/work/amey/history-1/.... (1 Reply)
Hi,
I have two files under two separate directories as in:
find . -name test.sh
./test.sh
./abc/test.sh
I want my find to only look for the file test.sh that is under the current directory and not one under /abc
How do I use prune to achieve this? I am on AIX (3 Replies)
Discussion started by: swasid
3 Replies
LEARN ABOUT CENTOS
pidof
PIDOF(8) Linux System Administrator's Manual PIDOF(8)NAME
pidof -- find the process ID of a running program.
SYNOPSIS
pidof [-s] [-c] [-n] [-x] [-m] [-o omitpid[,omitpid..]] [-o omitpid[,omitpid..]..] program [program..]
DESCRIPTION
Pidof finds the process id's (pids) of the named programs. It prints those id's on the standard output. This program is on some systems
used in run-level change scripts, especially when the system has a System-V like rc structure. In that case these scripts are located in
/etc/rc?.d, where ? is the runlevel. If the system has a start-stop-daemon (8) program that should be used instead.
OPTIONS -s Single shot - this instructs the program to only return one pid.
-c Only return process ids that are running with the same root directory. This option is ignored for non-root users, as they will be
unable to check the current root directory of processes they do not own.
-n Avoid stat(2) system function call on all binaries which are located on network based file systems like NFS. Instead of using this
option the the variable PIDOF_NETFS may be set and exported.
-x Scripts too - this causes the program to also return process id's of shells running the named scripts.
-o omitpid
Tells pidof to omit processes with that process id. The special pid %PPID can be used to name the parent process of the pidof pro-
gram, in other words the calling shell or shell script.
-m When used with -o, will also omit any processes that have the same argv[0] and argv[1] as any explicitly omitted process ids. This
can be used to avoid multiple shell scripts concurrently calling pidof returning each other's pids.
EXIT STATUS
0 At least one program was found with the requested name.
1 No program was found with the requested name.
NOTES
pidof is actually the same program as killall5; the program behaves according to the name under which it is called.
When pidof is invoked with a full pathname to the program it should find the pid of, it is reasonably safe. Otherwise it is possible that
it returns pids of running programs that happen to have the same name as the program you're after but are actually other programs. Note
that that the executable name of running processes is calculated with readlink(2), so symbolic links to executables will also match.
SEE ALSO shutdown(8), init(8), halt(8), reboot(8), killall5(8)AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl
01 Sep 1998 PIDOF(8)