@
julyclyde #11 因为没用过 strace ,不知 strace locate --regex '/bin/(bz|gz|zip)'这样对不对?
它显示的东西太多了只截取前部分和后部,中间基本都是 read(3,.....之类的内容
~/workspaces/cat$ strace locate --regex '/bin/(bz|gz|zip)'
execve("/usr/bin/locate", ["locate", "--regex", "/bin/(bz|gz|zip)"], 0x7ffd16805b50 /* 53 vars */) = 0
brk(NULL) = 0x5643604f8000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe61c87470) = -1 EINVAL (无效的参数)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbfa3762000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (没有那个文件或目录)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=73967, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 73967, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbfa374f000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\237\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0"..., 48, 848) = 48
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\244;\374\204(\337f#\315I\214\234\f\256\271\32"..., 68, 896) = 68
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=2216304, ...}, AT_EMPTY_PATH) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 2260560, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbfa3400000
......
read(3, "0000cf67-0006076eea03b003.journa"..., 4096) = 4096
read(3, "e-le64.cache-7\0\0d677cdf-5295-4fc"..., 4096) = 4096
read(3, "le64.cache-7\0\377101a04ab-0cd4-493e"..., 4096) = 3493
read(3, "", 4096) = 0
close(3) = 0
close(1) = 0
close(2) = 0
exit_group(1) = ?
+++ exited with 1 +++