For some files you only get the PID of some processes related to files in the "Most Active Files" list, but if you scroll down to "Most Active Files Process-Wise" you will find those PIDs again and a column with the filename.
For files where you only got the i-node and the device, let's say /dev/hd2 (/usr), you can do the following:
Hi All,
I see similar problems in past threads but so far no answers have worked for me. I am trying to write a script which parses a txt file that contains one filename per line, then finds those files on the local disk and copies them to a specified directory.
What I have:
... (4 Replies)
Hi,:cool:
I have a list of files in a directory.I need to store them in a file with the prefix of @ by using a command..
ex:@p_po.plb
@p_ebiz_roster_data.plb
any idea pls.
cheers
RRK (2 Replies)
Hi,
To start, I am using a bash shell on a G4 powerbook running Leopard. I am attempting to write a shell script that will automate the processing of satellite imagery. All the filenames are of the following construction:
A2008196000500.L2
where A indicates the sensor, the next four... (6 Replies)
Using a small script, I automatically generated some text logs. The files ended being undownloadable, unopenable and undeletable. Upon further investigation, the files ended up looking like this:
log\r
log2\r
log3\r
I've tried a few different things, including double slashing before the... (6 Replies)
How can I loose a part of the filename
I want to drop the “_<Number>.sql”
Below I have a listing of file names in a file
Eg :
CREDIT_DEL_033333.sql I want it to be CREDIT_DEL
ATM_DEBIT_CARD_0999999.sql I want it to be ... (3 Replies)
Hi Folks,
I'm looking for some ideas on how to change some file names. I'm pretty sure I need to use sed or awk but they still escape me. The files I have are like:
VOD0615 NEW Blades R77307.pdf or
VOD0615_NEW_Blades_R77307.pdf
and what I want after processing is:
R77307 NEW Blades.pdf
... (5 Replies)
Hi.
I'm trying to get the names of files from a log file, without the path and special characters.
I have a file that contains lines like this:
'/path/to/files/file00010000070874.EXT'
'/path/to/files/file00010000070875.EXT'
'/path/to/files/file00010000070876.EXT'... (4 Replies)
Hi:
mkisofs -graft-points -rational-rock -joliet -joliet-long -full-iso9660-filenames -iso-level 2 -o /tmp/image.iso STORE1/=/almacen/strauss
In /almacen/strauss there are filenames containing not only spaces but accented characters as well. I burned the image to DVD, with the result that all... (2 Replies)
Hi,
In my previous post I looked for timestamp to be added to the filename
https://www.unix.com/shell-programming-scripting/230603-how-append-timestamp-filenames-using-find.html
Now how do I select those files that do not have timestamp in the filenames.
I tried the following. My file has... (3 Replies)
Hi,
Its been a long time since I've done any shell scripting and I need some help here. Thanks in advance...
I need this as a bourne or csh script running under SCO.
In a folder I have a list of Backup files named with "TarBackup plus a date and time component suffix" like this;
... (2 Replies)
Discussion started by: stanlyn
2 Replies
LEARN ABOUT NETBSD
filemon
FILEMON(4) BSD Kernel Interfaces Manual FILEMON(4)NAME
filemon -- track interesting system calls
SYNOPSIS
#include <filemon.h>
DESCRIPTION
filemon provides a means for tracking the successful system calls performed by a process. It is used by make(1) to track the activities of
build scripts, for the purpose of automatically learning dependencies.
The data captured by filemon for the script
n=`wc -l /etc/motd`; echo "int motd_lines = $n;" > foo.h.new
cmp -s foo.h foo.h.new 2> /dev/null || mv foo.h.new foo.h
looks like:
# filemon version 4
# Target pid 24291
V 4
E 29676 /bin/sh
R 29676 /etc/ld.so.conf
R 29676 /lib/libedit.so.2
R 29676 /lib/libtermcap.so.0
R 29676 /lib/libc.so.12
F 29676 4899
E 4899 /usr/bin/wc
R 4899 /etc/ld.so.conf
R 4899 /usr/lib/libc.so.12
R 4899 /etc/motd
X 4899 0
W 29676 foo.h.new
X 29676 0
# Bye bye
E 3250 /bin/sh
R 3250 /etc/ld.so.conf
R 3250 /lib/libedit.so.2
R 3250 /lib/libtermcap.so.0
R 3250 /lib/libc.so.12
W 26673 /dev/null
E 26673 /usr/bin/cmp
R 26673 /etc/ld.so.conf
R 26673 /usr/lib/libc.so.12
X 26673 2
E 576 /bin/mv
R 576 /etc/ld.so.conf
R 576 /lib/libc.so.12
M 576 'foo.h.new' 'foo.h'
X 576 0
X 3250 0
# Bye bye
Most records follow the format:
type pid data
where type is one of the list below, and unless otherwise specified, data is a pathname.
C chdir(2).
D unlink(2).
E exec(3).
F fork(2), vfork(2); data is the process id of the child.
L link(2), symlink(2); data is two pathnames.
M rename(2); data is two pathnames.
R open(2) for read or read-write.
W open(2) for writing or read-write.
X exit(3); data is the exit status.
V indicates the version of filemon.
FILES
/dev/filemon
EXAMPLES
The following example demonstrates the basic usage of filemon:
#include <filemon.h>
pid_d pid;
int fd, tfd;
int status;
filemon_fd = open("/dev/filemon", O_RDWR);
temp_fd = mkstemp("/tmp/filemon.XXXXXXX");
/* give filemon the temp file to use */
ioctl(filemon_fd, FILEMON_SET_FD, &temp_fd);
/* children do not need these once they exec */
fcntl(filemon_fd, F_SETFD, 1);
fcntl(temp_fd, F_SETFD, 1);
pid = fork();
switch(pid) {
case -1:
err(1, "cannot fork");
break;
case 0:
pid = getpid();
/* tell filemon to monitor this process */
ioctl(filemon_fd, FILEMON_SET_PID, &pid);
execvp(...);
_exit(1);
break;
default:
status = wait();
close(filemon_fd);
lseek(temp_fd, SEEK_SET, 0);
/* read the captured syscalls from temp_fd */
close(temp_fd);
break;
}
The output of filemon is intended to be simple to parse. It is possible to achieve almost equivalent results with dtrace(1) though on many
systems this requires elevated privileges. Also, ktrace(1) can capture similar data, but records failed system calls as well as successful,
and is thus more complex to post-process.
HISTORY
filemon was contributed by Juniper Networks.
BSD September 29, 2011 BSD