I want to use "dtrace" to track file tranfer in OSX 10.8 , like when command "mv /folder1/file1 /folder2" is run .

I know there're probes like create/link/unlink/rename/chdir can be used in the form of

dtrace -n 'syscall::create:entry { printf("%s %s", execname, copyinstr(arg0)); }'

but how to trace this "mv" command ?

有帮助吗?

解决方案

rename is the function you are after:

dtrace -n 'syscall::rename:entry { printf("mv %s %s\n",copyinstr(arg0),copyinstr(arg1)); }'

(Add sudo infront if required)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top