{"id":7541,"date":"2013-06-24T14:29:11","date_gmt":"2013-06-24T18:29:11","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=7541"},"modified":"2022-02-08T11:23:54","modified_gmt":"2022-02-08T16:23:54","slug":"opensnoop","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/06\/24\/opensnoop\/","title":{"rendered":"opensnoop"},"content":{"rendered":"<p><a href=\"http:\/\/gigaom.com\/2008\/01\/14\/hidden-gems-in-leopard-opensnoop\/\">Bob Rudis<\/a> (via <a href=\"http:\/\/thought-palace.tumblr.com\/post\/53770813768\/opensnoop\">Jens Alfke<\/a>):<\/p>\n<blockquote cite=\"http:\/\/gigaom.com\/2008\/01\/14\/hidden-gems-in-leopard-opensnoop\/\"><p>Leopard ships with something called <a href=\"http:\/\/www.mactech.com\/articles\/mactech\/Vol.23\/23.11\/ExploringLeopardwithDTrace\/index.html\">DTrace<\/a> that gives developers and administrators the ability to take a peek at what all running code is doing in a flexible and dynamic way. Giving DTrace the coverage it deserves is beyond a simple blog post, but there are some smaller utilities &#8211; like <code>opensnoop<\/code> &#8211; that take advantage of the power of DTrace, but on a more targeted scale which are worthy of a minor exposition. The main purpose of the <code>opensnoop<\/code> utility is to provide a report of file opens as they occur.<\/p><\/blockquote>\n<p>Here&rsquo;s the <a href=\"http:\/\/developer.apple.com\/library\/mac\/documentation\/Darwin\/Reference\/ManPages\/man1\/opensnoop.1m.html\">man page<\/a>. This seems like a good alternative to <tt>fs_usage<\/tt> for certain use cases.<\/p>\n\n<p id=\"opensnoop-update-2022-02-08\">Update (2022-02-08): <a href=\"https:\/\/twitter.com\/LOLgrep\/status\/1490774155846840323\">LOLgrep<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/LOLgrep\/status\/1490774155846840323\">\n<p>It&rsquo;s insane how useful <code>opensnoop -t -f \"\/Some\/Path\/ThatYouWannaObserveWhoIsOpening\/It\"<\/code> is<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Bob Rudis (via Jens Alfke): Leopard ships with something called DTrace that gives developers and administrators the ability to take a peek at what all running code is doing in a flexible and dynamic way. Giving DTrace the coverage it deserves is beyond a simple blog post, but there are some smaller utilities &#8211; like [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-02-08T16:23:56Z","apple_news_api_id":"f6c5c4eb-4496-415b-8cf9-0198d9e7c29c","apple_news_api_modified_at":"2022-02-08T16:23:57Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/A9sXE60SWQVuM-QGY2efCnA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[323,480,30,479,318],"class_list":["post-7541","post","type-post","status-publish","format-standard","hentry","category-technology","tag-dtrace","tag-fs_usage","tag-mac","tag-opensnoop","tag-terminal"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=7541"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7541\/revisions"}],"predecessor-version":[{"id":34943,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7541\/revisions\/34943"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=7541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=7541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=7541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}