Have you ever want to find out a bit more detail about what just your organisation is doing at a given decimal point in time ? Perhaps your hard crusade is thresh about , or a platform is crashing at the same dapple each time you course it , or you ’d wish to see exactly which filing cabinet get modified when you vary a yield programme ’s options . Although there are no foolproof methods of figuring this stuff out , one of the tools you could put to use is a Unix utility squall fs_usage . Today ’s trace will show you the staple of using it , and give some examples of how it might help you figure out what ’s going on with your machine .
fs_usage is a genuine - time tool ( i.e. it go and creates end product as things pass off ) that account activity related to the file organization . When found , it will immediately start fulfil your Terminal screen with output , even if you ’re not doing anything other than just sitting there watch it . You must lam fs_usage as antecedent , as it use a arrangement - level shaft to act . Here ’s an example of just a few seconds of its output . As you’re able to see , there ’s atonof data that goes flying by , and too speedily to read . You are n’t necessarily concerned with what you see in material time , though . As a abbreviated overview , let ’s just calculate at one line of the yield :
The first pillar ( 08:25:15 ) is the time of the entry ; the 2nd ( getattrlist ) is the factual file arrangement command being fulfill ( more on that in a bit ) , the third column is the file involved ( if applicable ; often this column is vacuous ) , the next column ( 0.000044 ) is the time postulate for execution , and the last pillar ( MicrosoftMouse ) is the name of the process that generated the activity . Of all of these , the two most interesting columns are the one for the file involved and the name of the career cognitive operation . It ’s those two values that may enable you to figure out what ’s happening on your system . you’re able to get more particular on fs_usage by reading its manual of arms by type man fs_usage in the Terminal .
As for the name of the actual command being action ( getattrlist in this casing ) , for the most part you do n’t need to sympathise what each command is ( though many are pretty obvious , such as read , write , etc . ) . However , if you ’re curious , you may look each of them up on Apple’sAPI Reference : Man Pages . utilise your browser app ’s lookup function to find the linkup to the dictation you ’d wish to read about ( they should all be in the area of the pageboy labeled Section 2 . As an example , here ’s the entrance for getarrlist .
So , how do you use all this seemingly arcane knowledge to facilitate with a job or interrogation regarding an program ? Here ’s how I put it to habituate …
As a good real - world case of putting fs_usage to wreak , see to it outthis hint , key how someone used it ( and remote admission via ssh ) to identify and prepare the causal agent of a crash that was keep the user from lumber in .
As I mentioned when I started this blog a couple weeks back , Friday ’s debut will incline to be the “ geekiest ” of the hebdomad , as you may understandably see by today ’s hint . This is not something you ’ll use on a regular basis , of track . But it can be quite useful in sure situation , and sometimes it ’s just kind of interesting to take a peep behind the cover song and see what you ’re machine ’s up to , even when you recollect it ’s just sitting there hold back for you to do something .