{"id":126303,"date":"2024-11-14T11:31:32","date_gmt":"2024-11-14T02:31:32","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=126303"},"modified":"2024-11-14T11:31:32","modified_gmt":"2024-11-14T02:31:32","slug":"macos-command-line-utility","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/macos-command-line-utility\/","title":{"rendered":"\u77e5\u3089\u306a\u3044\u3068\u640d\u3057\u3066\u308bmacOS\u306e\u4fbf\u5229\u306a\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2024\/11\/s_20241114_110250.jpg\" alt=\"\" width=\"900\" height=\"560\" class=\"aligncenter size-full wp-image-126304\" \/><\/p>\n<p>macOS\u306fUNIX\u30d9\u30fc\u30b9\u306e\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3067\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u5404\u7a2e\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u30b7\u30b9\u30c6\u30e0\u306e\u64cd\u4f5c\u3084\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u52b9\u7387\u7684\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>ls\u3001cd\u3001grep\u3001find\u3068\u3044\u3063\u305fLinux\u3067\u3082\u304a\u99b4\u67d3\u307f\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u7ba1\u7406\u3084\u691c\u7d22\u3001\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u3092\u52b9\u7387\u7684\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3060\u3051\u3067\u306f\u306a\u304f\u3001macOS\u306b\u56fa\u6709\u306e\u4fbf\u5229\u306a\u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3059\u3002<\/p>\n<p>\u958b\u767a\u8005\u306eWei Yen\u6c0f\u306f\u3001macOS\u3067\u5229\u7528\u3067\u304d\u308b\u4fbf\u5229\u306a\u30b3\u30de\u30f3\u30c9\u3092<a href=\"https:\/\/weiyen.net\/articles\/useful-macos-cmd-line-utilities\">\u307e\u3068\u3081\u3066\u7d39\u4ecb<\/a>\u3057\u3066\u3044\u307e\u3059\u3002\u3068\u308a\u3042\u3052\u3089\u308c\u3066\u3044\u308b\u30b3\u30de\u30f3\u30c9\u306fmacOS\u56fa\u6709\u306e\u3082\u306e\u304c\u591a\u304f\u3001UNIX\u3084Linux\u306b\u8a73\u3057\u3044\u65b9\u306b\u3068\u3063\u3066\u3082\u65b0\u305f\u306a\u767a\u898b\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<h2>\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306b\u30a2\u30af\u30bb\u30b9<\/h2>\n<p><code>security<\/code>\u30b3\u30de\u30f3\u30c9\u3067\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre>\r\nsecurity find-internet-password -s \"https:\/\/example.com\"\r\n<\/pre>\n<h2>\u30d5\u30a1\u30a4\u30eb\u3092\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u958b\u304f<\/h2>\n<p><code>open<\/code>\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u30a2\u30d7\u30ea\u3067\u958b\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre>\r\nopen file.txt\r\n<\/pre>\n<p>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3059\u308c\u3070Finder\u3067\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u958b\u304f\u3053\u3068\u3082\u3002<\/p>\n<pre>\r\nopen .\r\n<\/pre>\n<h2>\u30b3\u30d4\u30fc\u30a2\u30f3\u30c9\u30da\u30fc\u30b9\u30c8<\/h2>\n<p><code>pbcopy<\/code>\u3068<code>pbpaste<\/code>\u3067\u30da\u30fc\u30b9\u30c8\u30dc\u30fc\u30c9(\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9)\u306b\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u3002<\/p>\n<pre>\r\n\r\necho \"Hello, world!\" | pbcopy\r\npbpaste\r\n\r\n>> Hello, world!\r\n<\/pre>\n<h2>UTC \u65e5\u4ed8<\/h2>\n<p>\u73fe\u5728\u6642\u523b\u3092UTC\u3067\u8868\u793a\u3059\u308b\u3002<\/p>\n<pre>\r\ndate -u\r\n<\/pre>\n<h2>\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30b9\u30d4\u30fc\u30c9\u30c6\u30b9\u30c8<\/h2>\n<p><code>networkQuality<\/code>\u3067\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30b9\u30d4\u30fc\u30c9\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u53ef\u80fd\u3002<\/p>\n<pre>\r\nnetworkQuality\r\n<\/pre>\n<h2>\u30b9\u30ea\u30fc\u30d7\u3092\u9632\u3050<\/h2>\n<p><code>caffeinate<\/code>\u30b3\u30de\u30f3\u30c9\u3067Mac\u306e\u30b9\u30ea\u30fc\u30d7\u3092\u9632\u3050\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre>\r\ncaffeinate\r\n<\/pre>\n<h2>UUID\u306e\u751f\u6210<\/h2>\n<p><code>uuidgen<\/code>\u3067UUID\u3092\u751f\u6210\u53ef\u80fd\u3002<\/p>\n<pre>\r\nuuidgen\r\n<\/pre>\n<h2>\u305d\u306e\u4ed6\u4fbf\u5229\u540d\u30b3\u30de\u30f3\u30c9<\/h2>\n<p>\u305d\u306e\u4ed6\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>mdfind: Spotlight\u691c\u7d22\u3092\u5b9f\u884c\u3002<\/li>\n<li>say: Mac\u3092\u3057\u3083\u3079\u3089\u305b\u308b\u3002<\/li>\n<li>screencapture: \u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u53d6\u5f97\u3002<\/li>\n<li>networksetup: \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3002 <\/li>\n<li>sips: \u3055\u307e\u3056\u307e\u306a\u753b\u50cf\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u5909\u63db\u3002<\/li>\n<li>ainfo: \u30aa\u30fc\u30c7\u30a3\u30aa\u30d5\u30a1\u30a4\u30eb\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u8abf\u3079\u308b\u3002<\/li>\n<li>mdls: \u5168\u3066\u306e\u7a2e\u985e\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u8abf\u3079\u308b\u3002<\/li>\n<li>afconvert: \u30aa\u30fc\u30c7\u30a3\u30aa\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u5909\u63db\u3002<\/li>\n<li>diskutil: \u30c7\u30a3\u30b9\u30af\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u7ba1\u7406\u3002<\/li>\n<li>powermetrics: \u30b7\u30b9\u30c6\u30e0\u306e\u6d88\u8cbb\u96fb\u529b\u76e3\u8996\u7528\u3002<\/li>\n<li>pmset: \u96fb\u6e90\u7ba1\u7406\u30bf\u30b9\u30af\u306e\u5b9f\u884c\u3002<\/li>\n<li>dot_clean: \u30c9\u30c3\u30c8\u3084\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u304b\u3089\u59cb\u307e\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3002Mac\u4ee5\u5916\u306e\u30de\u30b7\u30f3\u3068\u30d5\u30a1\u30a4\u30eb\u3092\u5171\u6709\u3059\u308b\u3068\u304d\u306b\u4fbf\u5229\u3002<\/li>\n<\/ul>\n<p>\u500b\u4eba\u7684\u306b\u306fmdfind\u304c\u4fbf\u5229\u3067\u826f\u304f\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\u5404\u30b3\u30de\u30f3\u30c9\u306e\u8aac\u660e\u306f\u300cman \u30b3\u30de\u30f3\u30c9\u540d\u300d\u3067\u78ba\u8a8d\u3067\u304d\u308b\u307b\u304b\u3001<a href=\"https:\/\/ss64.com\/mac\/\">https:\/\/ss64.com\/mac\/<\/a>\u3067\u8abf\u3079\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u307e\u305f<a href=\"https:\/\/news.ycombinator.com\/item?id=42057431\">Hacker News<\/a>\u3067\u3082Mac\u306e\u4fbf\u5229\u306a\u30b3\u30de\u30f3\u30c9\u306b\u95a2\u3059\u308b\u8b70\u8ad6\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3055\u3089\u306b\u60c5\u5831\u3092\u6df1\u6398\u308a\u3057\u305f\u3044\u65b9\u306f\u53c2\u8003\u306b\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>macOS\u306fUNIX\u30d9\u30fc\u30b9\u306e\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3067\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u5404\u7a2e\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u30b7\u30b9\u30c6\u30e0\u306e\u64cd\u4f5c\u3084\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u52b9\u7387\u7684\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 ls\u3001cd\u3001grep\u3001find\u3068\u3044\u3063\u305fLinux\u3067\u3082\u304a\u99b4\u67d3\u307f\u306e\u30b3 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":126304,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[2047],"tags":[3299,3480],"class_list":["post-126303","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips","tag-mac","tag-macos"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/126303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=126303"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/126303\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/126304"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=126303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=126303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=126303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}