{"id":391,"date":"2005-04-14T22:13:54","date_gmt":"2005-04-14T12:13:54","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=391"},"modified":"2013-10-04T09:26:22","modified_gmt":"2013-10-03T23:26:22","slug":"binstat","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2005\/04\/14\/binstat\/","title":{"rendered":"~\/bin\/stat"},"content":{"rendered":"<p>What have you <b>always<\/b> wanted on the command line?<\/p>\n<p><em>stat?<\/em> i: hear; you cry! (insert more [silly] {punctuation} around &#8216;ere!)<\/p>\n<p>I present, to you, my ~\/bin\/stat<\/p>\n<pre>\r\n#!\/usr\/bin\/perl\r\nuse POSIX qw(strftime);\r\n\r\nmy $FORMAT=\"%H:%M %a, %e %b %y\";\r\n\r\nforeach(@ARGV)\r\n{\r\n  my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,\r\n      $atime,$mtime,$ctime,$blksize,$blocks)\r\n      = stat($_);\r\n  print $_.\"\\n\";\r\n  print \"Dev:   $dev\\n\";\r\n  print \"inode: $ino\\n\";\r\n  print \"mode:  $mode\\n\";\r\n  print \"nlink: $nlink\\n\";\r\n  print \"uid:   $uid\\n\";\r\n  print \"gid:   $gid\\n\";\r\n  print \"rdev:  $rdev\\n\";\r\n  print \"size:  $size\\n\";\r\n  print \"atime: \".strftime($FORMAT,localtime($atime)).\"\\n\";\r\n  print \"mtime: \".strftime($FORMAT,localtime($mtime)).\"\\n\";\r\n  print \"ctime: \".strftime($FORMAT,localtime($ctime)).\"\\n\";\r\n  print \"blksz: $blksize\\n\";\r\n  print \"blks:  $blocks\\n\\n\";\r\n}\r\n<\/pre>\n<p>it&#8217;ll make it to <a href=\"https:\/\/www.flamingspork.com\/junkcode\/\">junkcode<\/a> sometime soon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What have you always wanted on the command line? stat? i: hear; you cry! (insert more [silly] {punctuation} around &#8216;ere!) I present, to you, my ~\/bin\/stat #!\/usr\/bin\/perl use POSIX qw(strftime); my $FORMAT=&#8221;%H:%M %a, %e %b %y&#8221;; foreach(@ARGV) { my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2005\/04\/14\/binstat\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-391","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s5a6n8-binstat","jetpack-related-posts":[{"id":69,"url":"https:\/\/www.flamingspork.com\/blog\/2003\/03\/18\/free-open-diary-import\/","url_meta":{"origin":391,"position":0},"title":"Free Open Diary Import","author":"Stewart Smith","date":"2003-03-18","format":false,"excerpt":"Well, I've imported all my old OpenDiary entries. Unfortunately, there's no easy way to export all the notes from OD, so they haven't made their way across. Below is the perl script I used to convert ODs export format into the MovableType import format: #!\/usr\/bin\/perl { open ODFILE,\"< $ARGV[0]\"; @entries=();\u2026","rel":"","context":"In &quot;life, the universe and everything&quot;","block_context":{"text":"life, the universe and everything","link":"https:\/\/www.flamingspork.com\/blog\/category\/life-the-universe-and-everything\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4574,"url":"https:\/\/www.flamingspork.com\/blog\/2020\/03\/22\/my-power9-cpu-core-layout\/","url_meta":{"origin":391,"position":1},"title":"My POWER9 CPU Core Layout","author":"Stewart Smith","date":"2020-03-22","format":false,"excerpt":"So, following on from my post on Sensors on the Blackbird (and thus Power9), I mentioned that when you look at the temperature sensors for each CPU core in my 8-core POWER9 chip, they're not linear numbers. Let's look at what that means.... stewart@blackbird9$ sudo ipmitool sensor | grep core\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot-from-2020-03-21-14-31-30-mycores-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot-from-2020-03-21-14-31-30-mycores-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot-from-2020-03-21-14-31-30-mycores-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot-from-2020-03-21-14-31-30-mycores-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":228,"url":"https:\/\/www.flamingspork.com\/blog\/2004\/04\/10\/tightly-packing-onodes\/","url_meta":{"origin":391,"position":2},"title":"Tightly packing onodes","author":"Stewart Smith","date":"2004-04-10","format":false,"excerpt":"The current problem is that an onode, however much we can pack forks into a block, still takes up a minimum of one disk block. A disk block typically being 4kb, and a tendancy to want to be bigger (think large media files), and also being the unit of atomicity\u2026","rel":"","context":"In &quot;fcfs&quot;","block_context":{"text":"fcfs","link":"https:\/\/www.flamingspork.com\/blog\/category\/fcfs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":392,"url":"https:\/\/www.flamingspork.com\/blog\/2005\/04\/15\/stillhqcom-stat-on-the-command-line\/","url_meta":{"origin":391,"position":3},"title":"stillhq.com &#8211; Stat on the command line","author":"Stewart Smith","date":"2005-04-15","format":false,"excerpt":"stillhq.com - Stat on the command line So Michael pointed out there is one.... in recent versions of coreutils at least. (umm... yeah... that's a good excuse. no really) I should retitle previous entry to something like: ever wanted \/usr\/bin\/stat on an older system? The copyright for \/usr\/bin\/stat is 2004\u2026","rel":"","context":"In &quot;life, the universe and everything&quot;","block_context":{"text":"life, the universe and everything","link":"https:\/\/www.flamingspork.com\/blog\/category\/life-the-universe-and-everything\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3959,"url":"https:\/\/www.flamingspork.com\/blog\/2015\/04\/28\/going-beyond-1-3-million-sql-queriessecond\/","url_meta":{"origin":391,"position":4},"title":"Going beyond 1.3 MILLION SQL Queries\/second","author":"Stewart Smith","date":"2015-04-28","format":false,"excerpt":"So, on a large IBM POWER8 system I was recently running the newly coined \"yesmark\" benchmark, which is best translated as this: Benchmark (N for concurrency): for i in {1..N}; do yes \"DO 0;\" | mysql > \/dev\/null & done Live results: mysqladmin -ri 1 extended-status | grep Questions Which\u2026","rel":"","context":"In &quot;IBM&quot;","block_context":{"text":"IBM","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/ibm-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3137,"url":"https:\/\/www.flamingspork.com\/blog\/2012\/07\/28\/finding-out-whats-next-at-barcampmel-2012-with-drizzle-sql-javascript-and-a-web-browser\/","url_meta":{"origin":391,"position":5},"title":"Finding out What&#8217;s Next at BarCampMel 2012 with Drizzle, SQL, JavaScript and a web browser","author":"Stewart Smith","date":"2012-07-28","format":false,"excerpt":"Just for the pure insane fun of it, I accepted the challenge of \"what can you do with the text format of the schedule?\" for BarCampMel. I'm a database guy, so I wanted to load it into a database (which would be Drizzle), and I wanted it to be easy\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":2,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":3444,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/391\/revisions\/3444"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}