{"id":118144,"date":"2024-01-22T10:50:02","date_gmt":"2024-01-22T01:50:02","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=118144"},"modified":"2024-01-22T10:50:02","modified_gmt":"2024-01-22T01:50:02","slug":"long-shell-history","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/long-shell-history\/","title":{"rendered":"\u9577\u3044\u30b7\u30a7\u30eb\u5c65\u6b74\u4fdd\u6301\u306e\u30b9\u30b9\u30e1"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2024\/01\/s_20240122_102635.jpg\" alt=\"S 20240122 102635\" title=\"s_20240122_102635.jpg\" border=\"0\" width=\"995\" height=\"621\" \/><\/p>\n<p>Zsh\u3084Bash\u3001Fish\u306a\u3069\u306e\u30e2\u30c0\u30f3\u306a\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b7\u30a7\u30eb\u306f\u3001\u5165\u529b\u3057\u305f\u30b3\u30de\u30f3\u30c9\u306e\u5c65\u6b74\u3092\u4fdd\u5b58\u3059\u308b\u30d2\u30b9\u30c8\u30ea\u30fc\u6a5f\u80fd\u3092\u642d\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d2\u30b9\u30c8\u30ea\u30fc\u6a5f\u80fd\u306b\u3088\u3063\u3066\u3001\u904e\u53bb\u306b\u5165\u529b\u3057\u305f\u30b3\u30de\u30f3\u30c9\u3092\u52b9\u7387\u826f\u304f\u518d\u5165\u529b\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308a\u3001\u751f\u7523\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3059\u3002\u3053\u306e\u30d2\u30b9\u30c8\u30ea\u30fc\u6a5f\u80fd\u306e\u91cd\u8981\u6027\u3084\u6d3b\u7528\u65b9\u6cd5\u3092\u7d39\u4ecb\u3059\u308b\u8a18\u4e8b\u300c<a href=\"https:\/\/registerspill.thorstenball.com\/p\/which-command-did-you-run-1731-days\">Which command did you run 1731 days ago?<\/a>\u300d\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30a8\u30f3\u30b8\u30cb\u30a2\u306eThorsten Ball\u6c0f\u306f\u3001Zsh\u306e\u5c65\u6b74\u30d5\u30a1\u30a4\u30eb<code>~\/.zsh_history<\/code>\u306b26278\u500b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059\u3002\u6700\u3082\u53e4\u3044\u30a8\u30f3\u30c8\u30ea\u30fc\u306f2019\u5e744\u670825\u65e5\u306b\u8a18\u9332\u3055\u308c\u305f\u3082\u306e\u3067\u3001Ctrl-r\u3092\u62bc\u3059\u3068\u3001<a href=\"https:\/\/github.com\/junegunn\/fzf\">fzf<\/a>\u304c\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3057\u3001\u904e\u53bb5\u5e74\u9593\u306e\u30b7\u30a7\u30eb\u5c65\u6b74\u306b\u542b\u307e\u308c\u308b26278\u500b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4e00\u77ac\u3067\u30d5\u30a1\u30b8\u30fc\u691c\u7d22\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a2d\u5b9a\u306b\u3088\u308a\u3001\u8907\u96d1\u306acurl\u30b3\u30de\u30f3\u30c9\u3084rsync\u30b3\u30de\u30f3\u30c9\u3001git\u3068grep\u3068find\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u30b3\u30de\u30f3\u30c9\u306a\u3069\u3001\u4e00\u304b\u3089\u5165\u529b\u3059\u308b\u306e\u304c\u56f0\u96e3\u306a\u30b3\u30de\u30f3\u30c9\u3092\u3059\u3050\u306b\u601d\u3044\u51fa\u3059\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u540c\u6c0f\u304c\u9577\u5e74\u4f7f\u3063\u3066\u304d\u305fZsh\u306e\u8a2d\u5b9a\u3067\u3059\u3002<\/p>\n<pre>\n\n##########\n# HISTORY\n##########\n\nHISTFILE=$HOME\/.zsh_history\nHISTSIZE=50000\nSAVEHIST=50000\n\n# Immediately append to history file:\nsetopt INC_APPEND_HISTORY\n\n# Record timestamp in history:\nsetopt EXTENDED_HISTORY\n\n# Expire duplicate entries first when trimming history:\nsetopt HIST_EXPIRE_DUPS_FIRST\n\n# Dont record an entry that was just recorded again:\nsetopt HIST_IGNORE_DUPS\n\n# Delete old recorded entry if new entry is a duplicate:\nsetopt HIST_IGNORE_ALL_DUPS\n\n# Do not display a line previously found:\nsetopt HIST_FIND_NO_DUPS\n\n# Dont record an entry starting with a space:\nsetopt HIST_IGNORE_SPACE\n\n# Dont write duplicate entries in the history file:\nsetopt HIST_SAVE_NO_DUPS\n\n# Share history between all sessions:\nsetopt SHARE_HISTORY\n\n# Execute commands using history (e.g.: using !$) immediatel:\nunsetopt HIST_VERIFY\n\n<\/pre>\n<p>\u3053\u306e\u8a2d\u5b9a\u3092fzf\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u30d5\u30a1\u30b8\u30fc\u691c\u7d22\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u540c\u6c0f\u306f\u307e\u305f\u3001\u30b7\u30a7\u30eb\u306e\u5c65\u6b74\u6a5f\u80fd\u3092\u5f37\u5316\u3059\u308b\u300c<a href=\"https:\/\/github.com\/atuinsh\/atuin\">Atuin<\/a>\u300d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3068\u3057\u3066\u3044\u307e\u3059\u3002Atuin\u306f\u30b7\u30a7\u30eb\u5c65\u6b74\u3092\u4fdd\u5b58\u3057\u305f\u308a\u691c\u7d22\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u8907\u6570\u306e\u30de\u30b7\u30f3\u3067\u30b7\u30a7\u30eb\u5c65\u6b74\u3092\u540c\u671f\u3057\u305f\u308a\u3001\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u304a\u3059\u3059\u3081\u306e\u30c4\u30fc\u30eb\u3060\u305d\u3046\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/news.ycombinator.com\/item?id=39076573\">Hacker News<\/a>\u3067\u3082\u30b7\u30a7\u30eb\u5c65\u6b74\u306b\u95a2\u3059\u308b\u8b70\u8ad6\u304c\u884c\u308f\u308c\u3066\u304a\u308a\u3001Atuin\u306e\u307b\u304b\u306b\u3082\u3001<a href=\"https:\/\/github.com\/larkery\/zsh-histdb\">zsh-histdb<\/a>\u306a\u3069\u6709\u7528\u306a\u30c4\u30fc\u30eb\u306e\u63d0\u6848\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002\u30b7\u30a7\u30eb\u5c65\u6b74\u3092\u6975\u3081\u305f\u3044\u65b9\u306f\u78ba\u8a8d\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zsh\u3084Bash\u3001Fish\u306a\u3069\u306e\u30e2\u30c0\u30f3\u306a\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b7\u30a7\u30eb\u306f\u3001\u5165\u529b\u3057\u305f\u30b3\u30de\u30f3\u30c9\u306e\u5c65\u6b74\u3092\u4fdd\u5b58\u3059\u308b\u30d2\u30b9\u30c8\u30ea\u30fc\u6a5f\u80fd\u3092\u642d\u8f09\u3057\u3066\u3044\u307e\u3059\u3002 \u30d2\u30b9\u30c8\u30ea\u30fc\u6a5f\u80fd\u306b\u3088\u3063\u3066\u3001\u904e\u53bb\u306b\u5165\u529b\u3057\u305f\u30b3\u30de\u30f3\u30c9\u3092\u52b9\u7387\u826f\u304f\u518d\u5165\u529b\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308a\u3001\u751f\u7523 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":118145,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[1360,339],"class_list":["post-118144","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-bash","tag-zsh"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/118144","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=118144"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/118144\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/118145"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=118144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=118144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=118144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}