{"id":255,"date":"2023-08-05T01:06:02","date_gmt":"2023-08-04T16:06:02","guid":{"rendered":"https:\/\/shugomatsuzawa.com\/techblog\/?p=255"},"modified":"2023-08-05T01:31:33","modified_gmt":"2023-08-04T16:31:33","slug":"zsh%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%a8%e3%80%81%e5%80%8b%e4%ba%ba%e7%9a%84%e8%a8%ad%e5%ae%9a%e4%be%8b","status":"publish","type":"post","link":"https:\/\/shugomatsuzawa.com\/techblog\/2023\/08\/05\/255\/","title":{"rendered":"Zsh\u306e\u4f7f\u3044\u65b9\u3068\u3001\u500b\u4eba\u7684\u8a2d\u5b9a\u4f8b"},"content":{"rendered":"\n<p>Mac\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30b7\u30a7\u30eb\u3067\u304a\u99b4\u67d3\u307f\u306eZsh\u3002\u3082\u3061\u308d\u3093\u4ed6\u306eLinux\u3084UNIX\u7cfbOS\u3067\u3082\u4f7f\u3048\u308b\u3002<br>\u8a2d\u5b9a\u65b9\u6cd5\u3092\u899a\u3048\u3066\u304a\u3051\u3070\u3001\u3069\u306e\u30de\u30b7\u30f3\u3067\u3082\u4f7f\u3044\u6163\u308c\u305f\u540c\u3058\u74b0\u5883\u3067\u4f5c\u696d\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067Zsh\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u304c\u308f\u304b\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>which zsh<\/code><\/pre>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308c\u3070Zsh\u306e\u30d5\u30eb\u30d1\u30b9\u304c\u308f\u304b\u308b\u3002<br>\u4f8b\u3048\u3070<code>\/bin\/zsh<\/code>\u3084<code>\/usr\/bin\/zsh<\/code>\u3001\u3055\u304f\u3089\u306e\u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u306a\u3089<code>\/usr\/local\/bin\/zsh<\/code>\u306a\u3069\u3060\u3002<\/p>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u5404OS\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install zsh<\/code><\/pre>\n\n\n\n<p>\u30d5\u30eb\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3001\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u3092\u5909\u66f4\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chsh -s \/usr\/bin\/zsh<\/code><\/pre>\n\n\n\n<p>\u3061\u306a\u307f\u306bAmazon Lightsail\u306e\u5834\u5408\u306fbitnami\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u308f\u304b\u3089\u306a\u3044\u306e\u3067\u3001sudo\u3067\u5165\u3063\u3066\u304b\u3089\u30e6\u30fc\u30b6\u30fc\u6307\u5b9a\u3067\u8a2d\u5b9a\u3059\u308b\u3068\u3044\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chsh -s \/usr\/bin\/zsh bitnami<\/code><\/pre>\n\n\n\n<p>\u518d\u5ea6\u30ed\u30b0\u30a4\u30f3\u3059\u308c\u3070\u30b7\u30a7\u30eb\u304c\u5909\u66f4\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3060\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u8a2d\u5b9a\u4f8b<\/h2>\n\n\n\n<p><code>.zprofile<\/code>\u306f<code>.bash_profile<\/code>\u306b\u76f8\u5f53\u3057\u3001\u30ed\u30b0\u30a4\u30f3\u6642\u306b\u5b9f\u884c\u3055\u308c\u308b\u3002<br><code>.zshrc<\/code>\u306f<code>.bashrc<\/code>\u306b\u76f8\u5f53\u3057\u3001\u65b0\u3057\u3044\u30bf\u30fc\u30df\u30ca\u30eb\u30bb\u30c3\u30b7\u30e7\u30f3\u3054\u3068\u306b\u5b9f\u884c\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<p>Amazon Lightsail\u306e\u3088\u3046\u306b\u5171\u901a\u306e<code>.profile<\/code>\u304c\u3042\u308b\u5834\u5408\u3001\u6b21\u306e<code>.zprofile<\/code>\u3092\u4f5c\u6210\u3059\u308b\u3068<code>.profile<\/code>\u306e\u5185\u5bb9\u3092\u53c2\u7167\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;&#91; -e ~\/.profile ]] &amp;&amp; emulate sh -c 'source ~\/.profile'<\/code><\/pre>\n\n\n\n<p><code>.zshrc<\/code>\u3082<code>.bashrc<\/code>\u306e\u5185\u5bb9\u3092\u30d9\u30fc\u30b9\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u3044\u3051\u3070\u3088\u3044\u3002<br>\u81ea\u5206\u304c\u3088\u304f\u8ffd\u8a18\u3057\u3066\u3044\u308b\u306e\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u65e5\u672c\u8a9e\u3092\u4f7f\u7528\nexport LANG=ja_JP.UTF-8\n\n# \u88dc\u5b8c\nautoload -Uz compinit\ncompinit\n\n# \u30b7\u30a7\u30eb\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u5b9f\u884c\u4e2d\u306e\u30b7\u30a7\u30eb\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u540d\u3092\u8868\u793a\u3059\u308b\nexport PROMPT=\"%K{blue}%n@%m%k(`uname -m`) %B%F{cyan}%(4~|...|)%3~%F{white} %# %b%f%k\"\n\n# \u30d2\u30b9\u30c8\u30ea\u30fc\u8a2d\u5b9a\nsetopt extended_history\nsetopt hist_ignore_dups\nsetopt hist_reduce_blanks<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/support.apple.com\/ja-jp\/HT208050\" data-type=\"URL\" data-id=\"https:\/\/support.apple.com\/ja-jp\/HT208050\" target=\"_blank\" rel=\"noreferrer noopener\">zsh \u3092 Mac \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30b7\u30a7\u30eb\u3068\u3057\u3066\u4f7f\u3046 &#8211; Apple \u30b5\u30dd\u30fc\u30c8 (\u65e5\u672c)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/ryota2357.com\/blog\/2022\/zsh-prompt-custom\/\" data-type=\"URL\" data-id=\"https:\/\/ryota2357.com\/blog\/2022\/zsh-prompt-custom\/\" target=\"_blank\" rel=\"noreferrer noopener\">zsh\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"Mac\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30b7\u30a7\u30eb\u3067\u304a\u99b4\u67d3\u307f\u306eZsh\u3002\u3082\u3061\u308d\u3093\u4ed6\u306eLinux\u3084UNIX\u7cfbOS\u3067\u3082\u4f7f\u3048\u308b\u3002\u8a2d\u5b9a\u65b9\u6cd5\u3092\u899a\u3048\u3066\u304a\u3051\u3070\u3001\u3069\u306e\u30de\u30b7\u30f3\u3067\u3082\u4f7f\u3044\u6163\u308c\u305f\u540c\u3058\u74b0\u5883\u3067\u4f5c\u696d\u3067\u304d\u308b\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067Zsh\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066 [&hellip;]","protected":false},"author":1,"featured_media":259,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8],"tags":[66,69,9,36,76,45,40,10],"class_list":["post-255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-system-management","tag-lightsail","tag-bitnami","tag-linux","tag-macos","tag-unix","tag-zsh","tag-sakura-rs","tag-memo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/shugomatsuzawa.com\/techblog\/wp-content\/uploads\/sites\/3\/2023\/08\/percent-g60810714c_1920.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":3,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":258,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/255\/revisions\/258"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media\/259"}],"wp:attachment":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}