{"id":5307,"date":"2026-01-15T15:00:29","date_gmt":"2026-01-15T06:00:29","guid":{"rendered":"https:\/\/www.miraiserver.ne.jp\/column\/?p=5307"},"modified":"2026-01-07T09:30:54","modified_gmt":"2026-01-07T00:30:54","slug":"about_grep","status":"publish","type":"post","link":"https:\/\/www.miraiserver.ne.jp\/column\/about_grep\/","title":{"rendered":"\u3010\u521d\u5fc3\u8005\u5411\u3051\u3011Linux\u306egrep\u30b3\u30de\u30f3\u30c9\u3068\u306f\uff1f\u57fa\u672c\u304b\u3089\u5fdc\u7528\u30fb\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u5bfe\u7b56\u307e\u3067\u89e3\u8aac\uff01"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-5311\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/Linux\u306egrep\u30b3\u30de\u30f3\u30c9\u3068\u306f\uff1f.webp\" alt=\"\" width=\"900\" height=\"500\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/Linux\u306egrep\u30b3\u30de\u30f3\u30c9\u3068\u306f\uff1f.webp 900w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/Linux\u306egrep\u30b3\u30de\u30f3\u30c9\u3068\u306f\uff1f-300x167.webp 300w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/Linux\u306egrep\u30b3\u30de\u30f3\u30c9\u3068\u306f\uff1f-640x356.webp 640w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/Linux\u306egrep\u30b3\u30de\u30f3\u30c9\u3068\u306f\uff1f-768x427.webp 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">Linux\u306egrep\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u7279\u5b9a\u306e\u6587\u5b57\u5217\u3092\u691c\u7d22\u30fb\u62bd\u51fa\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/span><\/strong>Linux\u74b0\u5883\u3067\u6700\u3082\u983b\u7e41\u306b\u4f7f\u308f\u308c\u308b\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u3064\u3067\u3042\u308a\u3001\u30ed\u30b0\u89e3\u6790\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30c1\u30a7\u30c3\u30af\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30c7\u30d0\u30c3\u30b0\u306a\u3069\u3001\u3055\u307e\u3056\u307e\u306a\u7528\u9014\u3067\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002<strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u672c\u8a18\u4e8b\u3067\u306f\u3001grep\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u691c\u7d22\u306e\u4ed5\u65b9\u3001\u3055\u3089\u306b\u306fsed\u3084awk\u3068\u3044\u3063\u305f\u95a2\u9023\u30b3\u30de\u30f3\u30c9\u3068\u306e\u9055\u3044\u307e\u3067\u3001\u521d\u5fc3\u8005\u306e\u65b9\u306b\u3082\u308f\u304b\u308a\u3084\u3059\u304f\u5fb9\u5e95\u89e3\u8aac\u3057\u307e\u3059\u3002<\/span><\/strong><\/p>\n<div class=\"well2\" style=\"text-align: center;\">\n<p style=\"text-align: center;\"><span style=\"color: #ff0000;\"><strong>\uff3c 2\u9031\u9593\u7121\u6599\u3067\u304a\u8a66\u3057\u3067\u304d\u307e\u3059\uff01 \uff0f<br \/>\n<a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-frame-btn&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-110 size-full\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2022\/08\/02_300x250_a.png\" alt=\"Unix\u7cfbOS\u5c02\u9580\u306e\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u300c\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u300d\" width=\"300\" height=\"250\" \/><\/a><\/strong><\/span><span style=\"text-decoration: underline;\"><strong>Unix\/Linux\u7cfbVPS\u3092\u3053\u306e\u4fa1\u683c\u3067\uff01<\/strong><\/span><span style=\"color: #ff0000;\"><strong><br \/>\n<\/strong><\/span>\u30fb<span style=\"font-size: 14px;\">\u5168\u30d7\u30e9\u30f3SSD\u642d\u8f09\u3067\u30b3\u30b9\u30c8\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u25ce<\/span><br \/>\n<span style=\"font-size: 14px;\">\u30fb\u8c4a\u5bcc\u306aOS\u30e9\u30a4\u30f3\u30a2\u30c3\u30d7<\/span><br \/>\n<span style=\"font-size: 14px;\">\u30fb\u5145\u5b9f\u306e\u7121\u6599\u30b5\u30dd\u30fc\u30c8<\/span><br \/>\n<a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-frame-btn&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\">VPS\u3092\u4f7f\u3063\u3066\u307f\u308b<\/a><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#grep\"><span class=\"toc_number toc_depth_1\">1<\/span> grep\u30b3\u30de\u30f3\u30c9\u3068\u306f<\/a><ul><li><a href=\"#grep-2\"><span class=\"toc_number toc_depth_2\">1.1<\/span> grep\u30b3\u30de\u30f3\u30c9\u306e\u5f79\u5272<\/a><\/li><li><a href=\"#i\"><span class=\"toc_number toc_depth_2\">1.2<\/span> \u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_2\">1.3<\/span> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6d3b\u7528\u3057\u305f\u4fbf\u5229\u306a\u4f7f\u3044\u65b9<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_2\">1.4<\/span> \u6b63\u898f\u8868\u73fe\u3092\u5229\u7528\u3057\u305f\u4f7f\u3044\u65b9<\/a><\/li><\/ul><\/li><li><a href=\"#sedawk\"><span class=\"toc_number toc_depth_1\">2<\/span> sed\/awk\u3068\u306e\u9055\u3044<\/a><ul><li><a href=\"#grepsedawk\"><span class=\"toc_number toc_depth_2\">2.1<\/span> grep\/sed\/awk\u306e\u9055\u3044<\/a><\/li><li><a href=\"#grepsedawk-2\"><span class=\"toc_number toc_depth_2\">2.2<\/span> grep\/sed\/awk\u306e\u4f7f\u3044\u5206\u3051<\/a><\/li><\/ul><\/li><li><a href=\"#grep-3\"><span class=\"toc_number toc_depth_1\">3<\/span> grep\u306e\u30a8\u30e9\u30fc\u5bfe\u7b56<\/a><ul><li><a href=\"#No_such_file_or_directory\"><span class=\"toc_number toc_depth_2\">3.1<\/span> \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\uff1aNo such file or directory<\/a><\/li><li><a href=\"#i-4\"><span class=\"toc_number toc_depth_2\">3.2<\/span> \u7d50\u679c\u304c\u306a\u306b\u3082\u8868\u793a\u3055\u308c\u306a\u3044<\/a><\/li><\/ul><\/li><li><a href=\"#grep-4\"><span class=\"toc_number toc_depth_1\">4<\/span> grep\u306b\u95a2\u3059\u308b\u3088\u304f\u3042\u308b\u8cea\u554f<\/a><ul><li><a href=\"#Q1grep\"><span class=\"toc_number toc_depth_2\">4.1<\/span> Q1.grep\u306f\u4f55\u304c\u3067\u304d\u307e\u3059\u304b\uff1f<\/a><\/li><li><a href=\"#Q2_grep\"><span class=\"toc_number toc_depth_2\">4.2<\/span> Q2 grep\u306b\u306f\u3069\u3093\u306a\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u304b\uff1f<\/a><\/li><li><a href=\"#Q3_grep\"><span class=\"toc_number toc_depth_2\">4.3<\/span> Q3 grep\u3067\u62bd\u51fa\u3055\u308c\u308b\u884c\u306e\u884c\u6570\u3092\u51fa\u529b\u3059\u308b\u306b\u306f\uff1f<\/a><\/li><\/ul><\/li><li><a href=\"#i-5\"><span class=\"toc_number toc_depth_1\">5<\/span> \u307e\u3068\u3081<\/a><\/li><li><a href=\"#UnixLinuxVPS\"><span class=\"toc_number toc_depth_1\">6<\/span> Unix\u3084Linux\u306eVPS\u306a\u3089\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc<\/a><\/li><\/ul><\/div>\n<h2 class=\"styled_h2\"><span id=\"grep\">grep\u30b3\u30de\u30f3\u30c9\u3068\u306f<\/span><\/h2>\n<h3 class=\"styled_h3\"><span id=\"grep-2\">grep\u30b3\u30de\u30f3\u30c9\u306e\u5f79\u5272<\/span><\/h3>\n<p>grep\u30b3\u30de\u30f3\u30c9\u306f\u3001Linux\u3067\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\uff08\u6a19\u6e96\u5165\u529b\u3092\u542b\u3080\uff09\u304b\u3089\u6307\u5b9a\u3057\u305f\u300c\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u300d\u3068\u4e00\u81f4\u3059\u308b\u884c\u3092\u62bd\u51fa\u3057\u3066\u8868\u793a\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u3010grep\u30b3\u30de\u30f3\u30c9\u306e\u66f8\u5f0f\u3011<\/p>\n<pre><code>grep [\u30aa\u30d7\u30b7\u30e7\u30f3] \u691c\u7d22\u30d1\u30bf\u30fc\u30f3 \u30d5\u30a1\u30a4\u30eb\u540d<\/code><\/pre>\n<p>\u69cb\u6587\u304c\u30b7\u30f3\u30d7\u30eb\u3067\u51e6\u7406\u3082\u8efd\u304f\u3001\u5927\u898f\u6a21\u306a\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3084\u591a\u6570\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3060\u3051\u3092\u52b9\u7387\u3088\u304f\u898b\u3064\u3051\u51fa\u3059\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"i\">\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/span><\/h3>\n<p>grep\u30b3\u30de\u30f3\u30c9\u306e\u57fa\u672c\u7684\u306a\u5f79\u5272\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u5bfe\u8c61\u306b\u3001\u6307\u5b9a\u3057\u305f\u300c\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u300d\u3068\u4e00\u81f4\u3059\u308b\u884c\u3092\u62bd\u51fa\u3057\u3066\u8868\u793a\u3059\u308b\u3053\u3068\u3067\u3059\u3002<strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u4f8b\u3048\u3070\u3001\u30b7\u30b9\u30c6\u30e0\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\uff08\u4f8b\uff1a\/var\/log\/syslog\uff09\u304b\u3089\u300cStart\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u3080\u884c\u3092\u691c\u7d22\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002<\/span><\/strong><\/p>\n<pre><code>grep \"Start\" \/var\/log\/syslog<\/code><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-5315\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf1-1.webp\" alt=\"\" width=\"602\" height=\"99\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf1-1.webp 602w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf1-1-300x49.webp 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/>\u5358\u7d14\u306a\u6587\u5b57\u5217\u3067\u3042\u308c\u3070\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\uff08&#8221; &#8220;\uff09\u3067\u56f2\u307e\u306a\u304f\u3066\u3082\u3088\u3044\u3067\u3059\u3002<strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u4e00\u65b9\u3001\u30b9\u30da\u30fc\u30b9\u3084\u30b7\u30a7\u30eb\u3067\u7279\u5225\u306a\u610f\u5473\u3092\u6301\u3064\u8a18\u53f7\uff08* \u306a\u3069\uff09\u3092\u542b\u3080\u5834\u5408\u306f\u3001\u610f\u56f3\u3057\u306a\u3044\u5c55\u958b\u3092\u9632\u3050\u305f\u3081\u306b\u5f15\u7528\u7b26\u3067\u56f2\u3080\u306e\u304c\u5b89\u5168\u3067\u3059\u3002\u7279\u306b\u3001\u30b7\u30a7\u30eb\u306b\u3088\u308b\u5f71\u97ff\u3092\u53d7\u3051\u306b\u304f\u3044\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\uff08&#8217; &#8216;\uff09\u3092\u63a8\u5968\u3057\u307e\u3059\u3002<\/span><\/strong><\/p>\n<h3 class=\"styled_h3\"><span id=\"i-2\">\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6d3b\u7528\u3057\u305f\u4fbf\u5229\u306a\u4f7f\u3044\u65b9<\/span><\/h3>\n<p>grep\u30b3\u30de\u30f3\u30c9\u306b\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u3001\u76ee\u7684\u306b\u5fdc\u3058\u3066\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u5fc5\u8981\u306a\u60c5\u5831\u3092\u7d20\u65e9\u304f\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002grep\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u3053\u306a\u3059\u7b2c\u4e00\u6b69\u3068\u3057\u3066\u3001\u4ee3\u8868\u7684\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u899a\u3048\u308b\u3053\u3068\u304b\u3089\u59cb\u3081\u3066\u307f\u308b\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<table width=\"600\">\n<tbody>\n<tr>\n<td style=\"text-align: center; vertical-align: middle; background-color: #dff7da;\" width=\"91\">\u30aa\u30d7\u30b7\u30e7\u30f3<\/td>\n<td style=\"text-align: center; vertical-align: middle; background-color: #dff7da;\" width=\"262\">\u6982\u8981<\/td>\n<td style=\"text-align: center; vertical-align: middle; background-color: #dff7da;\" width=\"247\">\u30b3\u30de\u30f3\u30c9\u4f8b<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"91\">-i<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"262\">\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u7121\u8996\u3057\u3066\u691c\u7d22<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"247\">grep -i &#8220;error&#8221; access.log<br \/>\n(ERROR,error,Error\u306e\u5168\u3066\u304c\u4e00\u81f4)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"91\">-v<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"262\">\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3057\u306a\u3044\u884c\u3092\u62bd\u51fa<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"247\">grep -v &#8220;INFO&#8221; access.log<br \/>\n(INFO\u30ed\u30b0\u3092\u9664\u5916\u3057\u3066\u8868\u793a)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"91\">-n<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"262\">\u4e00\u81f4\u3057\u305f\u884c\u306e\u884c\u756a\u53f7\u3082\u8868\u793a<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"247\">grep -n &#8220;WARNING&#8221; access.log<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"91\">-r<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"262\">\u30b5\u30d6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u3092\u518d\u5e30\u7684\u306b\u691c\u7d22<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"247\">grep -r &#8220;8080&#8221; \/etc\/<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"91\">-l<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"262\">\u4e00\u81f4\u3057\u305f\u5185\u5bb9\u306f\u8868\u793a\u305b\u305a\u3001\u30d1\u30bf\u30fc\u30f3\u3092\u542b\u3080\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u307f\u51fa\u529b<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"247\">grep -l &#8220;DEBUG&#8221; *.log<br \/>\n(DEBUG\u3092\u542b\u3080\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u540d\u3060\u3051\u8868\u793a)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"91\">-c<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"262\">\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3057\u305f\u884c\u6570\u306e\u307f\u51fa\u529b<br \/>\n\u203b\u51fa\u73fe\u56de\u6570\u3067\u306f\u306a\u3044<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"247\">grep -c &#8220;ERROR&#8221; access.log<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"91\">-A N<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"262\">\u4e00\u81f4\u3057\u305f\u884c\u3068\u5f8c\uff08After\uff09N\u884c\u3082\u8868\u793a<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"247\">grep -A 3 &#8220;FATAL&#8221; access.log (FATAL\u884c\u3068\u6b21\u306e3\u884c\u3092\u8868\u793a)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"91\">-B N<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"262\">\u4e00\u81f4\u3057\u305f\u884c\u3068\u524d\uff08Before\uff09N\u884c\u3082\u8868\u793a<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"247\">grep -B 5 &#8220;exception&#8221; access.log<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u7279\u306b\u300c-n\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u4e00\u81f4\u3057\u305f\u884c\u756a\u53f7\u3092\u8868\u793a\u3067\u304d\u308b\u305f\u3081\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u7b87\u6240\u306e\u7279\u5b9a\u306b\u5f79\u7acb\u3061\u3001\u300c-A\u300d\u3084\u300c-B\u300d\u306f\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3060\u3051\u3067\u306a\u304f\u3001\u305d\u306e\u524d\u5f8c\u306e\u6587\u8108\u3082\u307e\u3068\u3081\u3066\u78ba\u8a8d\u3067\u304d\u3001\u539f\u56e0\u8abf\u67fb\u304c\u30b9\u30e0\u30fc\u30ba\u306b\u306a\u308a\u307e\u3059\u3002<\/span><\/strong><\/p>\n<h3 class=\"styled_h3\"><span id=\"i-3\">\u6b63\u898f\u8868\u73fe\u3092\u5229\u7528\u3057\u305f\u4f7f\u3044\u65b9<\/span><\/h3>\n<p>grep\u306f\u300c\u6b63\u898f\u8868\u73fe\u300d\u3092\u5229\u7528\u3057\u3066\u3001\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u3092\u67d4\u8edf\u306b\u6307\u5b9a\u3067\u304d\u308b\u70b9\u304c\u4fbf\u5229\u3067\u3059\u3002\u6b63\u898f\u8868\u73fe\u3068\u306f\u3001\u6587\u5b57\u5217\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u3072\u3068\u3064\u306e\u6587\u5b57\u5217\u3067\u8868\u73fe\u3059\u308b\u305f\u3081\u306e\u8a18\u8ff0\u30eb\u30fc\u30eb\u3067\u3059\u3002grep\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067<strong><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">\u300c\u57fa\u672c\u6b63\u898f\u8868\u73fe\uff08Basic Regular Expression: BRE\uff09\u300d<\/span><\/strong>\u3068\u3057\u3066\u89e3\u91c8\u3057\u307e\u3059\u3002\u3088\u308a\u8868\u73fe\u529b\u306e\u9ad8\u3044<strong><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">\u300c\u62e1\u5f35\u6b63\u898f\u8868\u73fe\uff08Extended Regular Expression: ERE\uff09\u300d<\/span><\/strong>\u3092\u4f7f\u3046\u5834\u5408\u306f\u300c-E\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\uff08\u307e\u305f\u306fegrep\u30b3\u30de\u30f3\u30c9\uff09\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b\u73fe\u5728egrep\u306f\u975e\u63a8\u5968\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<pre><code>grep -E [\u30aa\u30d7\u30b7\u30e7\u30f3] '\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3' \u30d5\u30a1\u30a4\u30eb\u540d<\/code><\/pre>\n<p>\u307e\u305f\u306f<\/p>\n<pre><code>egrep [\u30aa\u30d7\u30b7\u30e7\u30f3] '\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3' \u30d5\u30a1\u30a4\u30eb\u540d<\/code><\/pre>\n<p style=\"text-align: center;\"><span style=\"color: #008000;\"><strong>Unix\/Linux<\/strong>\u3092<strong>VPS<\/strong>\u3067\u5229\u7528\u3059\u308b\u306a\u3089<strong style=\"font-size: 16px;\"><span style=\"color: #339966;\"><br \/>\n<\/span><\/strong><strong><span style=\"color: #ff0000;\">\uff3c2\u9031\u9593\u7121\u6599\u30fb\u5168\u30d7\u30e9\u30f3SSD\u642d\u8f09\uff0f<\/span><br \/>\n<a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/?utm_source=article-frame&amp;utm_medium=referral&amp;utm_campaign=miraiserver\" target=\"_blank\" rel=\"noopener\">\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3092\u7121\u6599\u3067\u8a66\u3059<\/a><\/strong> <\/span><\/p>\n<h2><\/h2>\n<h2 class=\"styled_h2\"><span id=\"sedawk\">sed\/awk\u3068\u306e\u9055\u3044<\/span><\/h2>\n<p><strong><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">grep\u3001sed\u3001awk<\/span><\/strong>\u306f\u3001Linux\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u4ee3\u8868\u7684\u306a\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u30b3\u30de\u30f3\u30c9\u3067\u3001\u3044\u305a\u308c\u3082\u975e\u5e38\u306b\u5f37\u529b\u3067\u3059\u304c\u3001\u305d\u308c\u305e\u308c\u5f97\u610f\u5206\u91ce\u304c\u7570\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u7ae0\u3067\u306f\u3001grep\u3068sed\u3001awk\u305d\u308c\u305e\u308c\u306e\u30b3\u30de\u30f3\u30c9\u306e\u9055\u3044\u3092\u7406\u89e3\u3057\u3001\u4f7f\u3044\u5206\u3051\u3089\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"grepsedawk\">grep\/sed\/awk\u306e\u9055\u3044<\/span><\/h3>\n<p>sed\u3001awk\u3082\u5171\u306bLinux\u30b5\u30fc\u30d0\u30fc\u3067\u3088\u304f\u4f7f\u7528\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002grep\u3068\u51e6\u7406\u304a\u3088\u3073\u5f79\u5272\u306e\u9055\u3044\u306f\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<table width=\"600\">\n<tbody>\n<tr>\n<td style=\"background-color: #dff7da; text-align: center; vertical-align: middle;\" width=\"81\">\u30b3\u30de\u30f3\u30c9<\/td>\n<td style=\"background-color: #dff7da; text-align: center; vertical-align: middle;\" width=\"195\">\u4e3b\u306a\u6a5f\u80fd<\/td>\n<td style=\"background-color: #dff7da; text-align: center; vertical-align: middle;\" width=\"324\">\u7279\u5fb4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"81\">grep<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"195\">\u884c\u306e\u691c\u7d22\u30fb\u62bd\u51fa<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"324\">\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u7279\u5b9a\u30d1\u30bf\u30fc\u30f3\u306e\u884c\u3092\u62bd\u51fa\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"81\">sed<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"195\">\u884c\u306e\u7f6e\u63db\u30fb\u7de8\u96c6<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"324\">\u884c\u306e\u7f6e\u63db\u30fb\u524a\u9664\u306a\u3069\u3092\u884c\u3044\u3001\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"81\">awk<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"195\">\u5217\u3054\u3068\u306e\u96c6\u8a08\u30fb\u6574\u5f62<\/td>\n<td style=\"text-align: center; vertical-align: middle;\" width=\"324\">\u30c6\u30ad\u30b9\u30c8\u3092\u5217\u306b\u5206\u5272\u3057\u3001\u8907\u96d1\u306a\u6761\u4ef6\u5206\u5c90\u3084\u96c6\u8a08\u3092\u884c\u3046<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>grep\u306f\u3001\u3042\u304f\u307e\u3067\u300c\u691c\u7d22\u3057\u3066\u8868\u793a\u3059\u308b\u300d\u3053\u3068\u306b\u7279\u5316\u3057\u3066\u304a\u308a\u3001\u901a\u5e38\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u307e\u305b\u3093\u3002sed\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u306e\u6587\u5b57\u5217\u306e\u8ffd\u52a0\u3084\u7f6e\u63db\u3001\u884c\u3092\u524a\u9664\u3068\u3044\u3063\u305f\u6587\u5b57\u5217\u306e\u52a0\u5de5\u304c\u884c\u3048\u307e\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u52a0\u5de5\u7d50\u679c\u3092\u6a19\u6e96\u51fa\u529b\u306b\u8868\u793a\u3059\u308b\u3060\u3051\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u3092\u66f8\u304d\u63db\u3048\u305f\u3044\u5834\u5408\u306f -i \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002awk\u306f\u3001\u5165\u529b\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u3092\u7a7a\u767d\u3084\u30bf\u30d6\u3067\u533a\u5207\u3063\u3066\u300c\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u300d\u3068\u3057\u3066\u6271\u3044\u3001$1, $2&#8230;\uff081\u5217\u76ee\u30012\u5217\u76ee\uff09\u3068\u3044\u3063\u305f\u5909\u6570\u3092\u4f7f\u3063\u3066\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u5358\u4f4d\u3067\u306e\u8907\u96d1\u306a\u51e6\u7406\u3084\u96c6\u8a08\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"grepsedawk-2\">grep\/sed\/awk\u306e\u4f7f\u3044\u5206\u3051<\/span><\/h3>\n<p>\u305d\u308c\u305e\u308c\u306e\u30b3\u30de\u30f3\u30c9\u306e\u4f7f\u3044\u5206\u3051\u3092\u307e\u3068\u3081\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong><span style=\"color: #ff9900;\">\u5358\u306a\u308b\u62bd\u51fa\uff08\u691c\u7d22\u3057\u3066\u8868\u793a\uff09\uff1agrep\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528<\/span><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code>grep \"\u30a8\u30e9\u30fc\" log.txt<\/code><\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong><span style=\"color: #ff9900;\">\u6587\u5b57\u5217\u306e\u7f6e\u63db\u30fb\u7de8\u96c6\uff08\u52a0\u5de5\uff09\uff1ased\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528<\/span><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code>sed 's\/old_host\/new_host\/g' config.txt<\/code><\/pre>\n<p>\u203b\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u3092\u66f8\u304d\u63db\u3048\u305f\u3044\u5834\u5408\u306f -i \u3092\u4ed8\u3051\u308b\uff08\u5b9f\u884c\u524d\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u63a8\u5968\uff09<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong><span style=\"color: #ff9900;\">\u30c7\u30fc\u30bf\u96c6\u8a08\/\u5217\u62bd\u51fa\uff08\u30d5\u30a3\u30fc\u30eb\u30c9\u51e6\u7406\uff09\uff1aawk\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528<\/span><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code>awk '{print $1,$3}' data.csv<\/code><\/pre>\n<p>\u203bCSV\u306f\u30ab\u30f3\u30de\u3084\u5f15\u7528\u7b26\u306e\u6709\u7121\u3067\u5d29\u308c\u308b\u3053\u3068\u304c\u3042\u308b\u305f\u3081\u3001\u307e\u305a\u306fTSV\uff08\u30bf\u30d6\u533a\u5207\u308a\uff09\u306a\u3069\u30b7\u30f3\u30d7\u30eb\u306a\u5f62\u5f0f\u3067\u306e\u5229\u7528\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u300c\u30a8\u30e9\u30fc\u884c\u3092\u62bd\u51fa\u300d\u3059\u308b\u3060\u3051\u306a\u3089\u3070\u3001grep\u304c\u6700\u9069\u3067\u3059\u3002\u30ed\u30b0\u8abf\u67fb\u3084\u8a2d\u5b9a\u78ba\u8a8d\u3067\u306fgrep\u306e\u51fa\u756a\u304c\u591a\u304f\u3001\u6700\u521d\u306b\u899a\u3048\u308b\u30b3\u30de\u30f3\u30c9\u3068\u3057\u3066\u9069\u3057\u3066\u3044\u307e\u3059\u3002<strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u4e00\u65b9\u3001\u62bd\u51fa\u5f8c\u306b\u7279\u5b9a\u306e\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3057\u305f\u3044\u5834\u5408\u306f\u3001grep\u3068sed\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3001sed\u5358\u4f53\u3067\u51e6\u7406\u3092\u884c\u3046\u3053\u3068\u304c\u4e00\u822c\u7684\u3067\u3059\u3002<\/span><\/strong>\u307e\u305a\u306fgrep\u3092\u3057\u3063\u304b\u308a\u7fd2\u5f97\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066sed\u3001awk\u3068\u9806\u306b\u5b66\u7fd2\u3092\u6df1\u3081\u3066\u3044\u304f\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p style=\"text-align: center;\"><span style=\"color: #008000;\"><strong>Unix\/Linux<\/strong>\u3092<strong>VPS<\/strong>\u3067\u5229\u7528\u3059\u308b\u306a\u3089<strong style=\"font-size: 16px;\"><span style=\"color: #339966;\"><br \/>\n<\/span><\/strong><strong><span style=\"color: #ff0000;\">\uff3c2\u9031\u9593\u7121\u6599\u30fb\u5168\u30d7\u30e9\u30f3SSD\u642d\u8f09\uff0f<\/span><br \/>\n<a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/?utm_source=article-frame&amp;utm_medium=referral&amp;utm_campaign=miraiserver\" target=\"_blank\" rel=\"noopener\">\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3092\u7121\u6599\u3067\u8a66\u3059<\/a><\/strong><br \/>\n<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2 class=\"styled_h2\"><span id=\"grep-3\">grep\u306e\u30a8\u30e9\u30fc\u5bfe\u7b56<\/span><\/h2>\n<p>grep\u306f\u4fbf\u5229\u306a\u4e00\u65b9\u3067\u3001\u6307\u5b9a\u65b9\u6cd5\u3092\u8aa4\u308b\u3068\u610f\u56f3\u3057\u305f\u7d50\u679c\u304c\u5f97\u3089\u308c\u306a\u304b\u3063\u305f\u308a\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u4e3b\u306a\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u3068\u5bfe\u51e6\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"No_such_file_or_directory\">\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\uff1aNo such file or directory<\/span><\/h3>\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u3001\u691c\u7d22\u5bfe\u8c61\u3068\u3057\u3066\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3084\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u5b58\u5728\u3057\u306a\u3044\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f<strong><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">\u300ctest.log\u300d<\/span><\/strong>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-5316\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf2-1.webp\" alt=\"\" width=\"449\" height=\"40\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf2-1.webp 449w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf2-1-300x27.webp 300w\" sizes=\"(max-width: 449px) 100vw, 449px\" \/><\/p>\n<p>\u4e3b\u306a\u539f\u56e0\u3068\u3057\u3066\u306f\u3001\u4e0b\u8a18\u306e3\u3064\u304c\u4e0a\u304c\u3089\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong><span style=\"color: #ff9900;\">\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u5165\u529b\u30df\u30b9\uff08\u62e1\u5f35\u5b50\u306e\u9055\u3044\u3001\u30bf\u30a4\u30d7\u30df\u30b9\u306a\u3069\uff09<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u6307\u5b9a\u3057\u305f\u30d1\u30b9\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\uff08\u5b9f\u884c\u5834\u6240\uff1d\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u52d8\u9055\u3044\uff09<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u76f8\u5bfe\u30d1\u30b9\uff0f\u7d76\u5bfe\u30d1\u30b9\u306e\u6307\u5b9a\u30df\u30b9<\/span><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 class=\"styled_h3\"><span id=\"i-4\">\u7d50\u679c\u304c\u306a\u306b\u3082\u8868\u793a\u3055\u308c\u306a\u3044<\/span><\/h3>\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3082\u306a\u306b\u3082\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u5834\u5408\u306f\u3001\u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u884c\u304c\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-5317\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf3-1.webp\" alt=\"\" width=\"487\" height=\"38\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf3-1.webp 487w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf3-1-300x23.webp 300w\" sizes=\"(max-width: 487px) 100vw, 487px\" \/><\/p>\n<p>\u672c\u6765\u306f\u30d2\u30c3\u30c8\u3059\u308b\u306f\u305a\u306a\u306e\u306b\u4f55\u3082\u8868\u793a\u3055\u308c\u306a\u3044\u5834\u5408\u306f\u3001\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u306e\u6307\u5b9a\u3084\u524d\u63d0\u6761\u4ef6\u306b\u539f\u56e0\u304c\u3042\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong><span style=\"color: #ff9900;\">\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u306e\u9055\u3044\uff08\u4f8b\uff1aError \u3068 error\uff09<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u5168\u89d2\u30fb\u534a\u89d2\u306e\u9055\u3044<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u6b63\u898f\u8868\u73fe\u306e\u30e1\u30bf\u6587\u5b57*\u3001() \u306a\u3069\u3092\u6587\u5b57\u3068\u3057\u3066\u691c\u7d22\u3067\u304d\u3066\u3044\u306a\u3044<\/span><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u7279\u306b\u3001\u6b63\u898f\u8868\u73fe\u3067\u201d\uff0a\u201d\u3084\u201d()\u201d\u306a\u3069\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\u3084\u300c\u00a5\u300d\u306a\u3069\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u3092\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u300c\uff0a\u300d\u3067\u306f\u691c\u7d22\u7d50\u679c\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u306a\u3044\u3082\u306e\u306e\u3001\u300c\\*\u300d\u3068\u6307\u5b9a\u3057\u305f\u5834\u5408\u306b\u691c\u7d22\u7d50\u679c\u304c\u5f97\u3089\u308c\u305f\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-5318\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf4-1.webp\" alt=\"\" width=\"388\" height=\"91\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf4-1.webp 388w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/12\/\u753b\u50cf4-1-300x70.webp 300w\" sizes=\"(max-width: 388px) 100vw, 388px\" \/><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #008000;\"><strong>Unix\/Linux<\/strong>\u3092<strong>VPS<\/strong>\u3067\u5229\u7528\u3059\u308b\u306a\u3089<strong style=\"font-size: 16px;\"><span style=\"color: #339966;\"><br \/>\n<\/span><\/strong><strong><span style=\"color: #ff0000;\">\uff3c2\u9031\u9593\u7121\u6599\u30fb\u5168\u30d7\u30e9\u30f3SSD\u642d\u8f09\uff0f<\/span><br \/>\n<a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/?utm_source=article-frame&amp;utm_medium=referral&amp;utm_campaign=miraiserver\" target=\"_blank\" rel=\"noopener\">\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3092\u7121\u6599\u3067\u8a66\u3059<\/a><\/strong><br \/>\n<\/span><\/p>\n<h2 class=\"styled_h2\"><span id=\"grep-4\">grep\u306b\u95a2\u3059\u308b\u3088\u304f\u3042\u308b\u8cea\u554f<\/span><\/h2>\n<p>grep\u306b\u95a2\u3059\u308b\u3088\u304f\u3042\u308b\u8cea\u554f\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<h3><span id=\"Q1grep\">Q1.grep\u306f\u4f55\u304c\u3067\u304d\u307e\u3059\u304b\uff1f<\/span><\/h3>\n<p>grep\u306f\u3001\u30c6\u30ad\u30b9\u30c8\uff08\u30d5\u30a1\u30a4\u30eb\u3084\u6a19\u6e96\u5165\u529b\uff09\u304b\u3089\u3001\u6307\u5b9a\u3057\u305f\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u884c\u3092\u62bd\u51fa\u3057\u3066\u8868\u793a\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u60c5\u5831\u304b\u3089\u3001\u300c\u3069\u306e\u884c\u306b\u7279\u5b9a\u306e\u6587\u5b57\u5217(\u30d1\u30bf\u30fc\u30f3)\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u300d\u3092\u898b\u3064\u3051\u51fa\u3057\u3001\u8a72\u5f53\u884c\u3060\u3051\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e3b\u306a\u7528\u9014:<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong><span style=\"color: #ff9900;\">\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u78ba\u8a8d<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u7279\u5b9a<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u542b\u3080\u8a2d\u5b9a\u306e\u62bd\u51fa<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u30c7\u30fc\u30bf\u306e\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/span><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3><span id=\"Q2_grep\">Q2 grep\u306b\u306f\u3069\u3093\u306a\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u304b\uff1f<\/span><\/h3>\n<p>\u4e3b\u306a\u7a2e\u985e\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u306e3\u3064\u304c\u3042\u308a\u307e\u3059\u3002\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u3092\u300c\u6b63\u898f\u8868\u73fe\u3068\u3057\u3066\u6271\u3046\u304b\u300d\u305d\u308c\u3068\u3082\u300c\u6587\u5b57\u5217\u305d\u306e\u307e\u307e\uff08\u56fa\u5b9a\u6587\u5b57\u5217\uff09\u3068\u3057\u3066\u6271\u3046\u304b\u300d\u3001\u305d\u3057\u3066\u6b63\u898f\u8868\u73fe\u3068\u3057\u3066\u6271\u3046\u5834\u5408\u306b\u3069\u306e\u66f8\u304d\u65b9\u30eb\u30fc\u30eb\u3092\u4f7f\u3046\u304b\u3067\u3059\u3002<\/p>\n<ul>\n<li><strong><span style=\"color: #ff9900;\">grep: \u6a19\u6e96\u30b3\u30de\u30f3\u30c9\u3002\u57fa\u672c\u6b63\u898f\u8868\u73fe (BRE) \u3068\u3057\u3066\u89e3\u91c8\u3057\u307e\u3059\u3002<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">grep -E (egrep): \u62e1\u5f35\u6b63\u898f\u8868\u73fe (ERE) \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002+, ?, |\u306a\u3069\u306e\u8a18\u53f7\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u306a\u3057\u3067\u4f7f\u3048\u307e\u3059\u3002\u6700\u3082\u4e00\u822c\u7684\u306b\u4f7f\u308f\u308c\u307e\u3059\u3002<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">grep -F (fgrep): \u56fa\u5b9a\u6587\u5b57\u5217\u3068\u3057\u3066\u306e\u307f\u30d1\u30bf\u30fc\u30f3\u3092\u89e3\u91c8\u3057\u3001\u6b63\u898f\u8868\u73fe\u3092\u4e00\u5207\u4f7f\u3044\u307e\u305b\u3093\u3002\u975e\u5e38\u306b\u9ad8\u901f\u306a\u5358\u7d14\u6587\u5b57\u5217\u691c\u7d22\u306b\u7279\u5316\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/strong><\/li>\n<\/ul>\n<p>\u203b\u306a\u304a\u3001egrep\u3084fgrep \u306f\u73fe\u5728\u975e\u63a8\u5968\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3><span id=\"Q3_grep\">Q3 grep\u3067\u62bd\u51fa\u3055\u308c\u308b\u884c\u306e\u884c\u6570\u3092\u51fa\u529b\u3059\u308b\u306b\u306f\uff1f<\/span><\/h3>\n<p>\u300c-c\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308c\u3070\u3001\u4e00\u81f4\u3057\u305f\u884c\u306e\u4ef6\u6570\uff08\u884c\u6570\uff09\u306e\u307f\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001access.log\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u201dERROR\u201d\u3068\u51fa\u529b\u3055\u308c\u305f\u884c\u6570\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre><code>grep -c \"ERROR\" access.log<\/code><\/pre>\n<p>\u203b\u88dc\u8db3\uff1a-c \u306f\u300c\u51fa\u73fe\u56de\u6570\u300d\u3067\u306f\u306a\u304f\u300c\u884c\u6570\u300d\u3067\u3059\u30021\u884c\u306b &#8220;ERROR&#8221; \u304c\u8907\u6570\u56de\u542b\u307e\u308c\u3066\u3044\u3066\u3082 1 \u884c\u3068\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u307e\u3059\u3002<\/p>\n<p style=\"text-align: center;\"><span style=\"color: #008000;\"><strong>Unix\/Linux<\/strong>\u3092<strong>VPS<\/strong>\u3067\u5229\u7528\u3059\u308b\u306a\u3089<strong style=\"font-size: 16px;\"><span style=\"color: #339966;\"><br \/>\n<\/span><\/strong><strong><span style=\"color: #ff0000;\">\uff3c2\u9031\u9593\u7121\u6599\u30fb\u5168\u30d7\u30e9\u30f3SSD\u642d\u8f09\uff0f<\/span><br \/>\n<a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/?utm_source=article-frame&amp;utm_medium=referral&amp;utm_campaign=miraiserver\" target=\"_blank\" rel=\"noopener\">\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3092\u7121\u6599\u3067\u8a66\u3059<\/a><\/strong><br \/>\n<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2 class=\"styled_h2\"><span id=\"i-5\">\u307e\u3068\u3081<\/span><\/h2>\n<p><strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u672c\u8a18\u4e8b\u3067\u306f\u3001grep\u30b3\u30de\u30f3\u30c9\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u30fb\u6b63\u898f\u8868\u73fe\u30fbsed\/awk \u3068\u306e\u4f7f\u3044\u5206\u3051\u3001\u3088\u304f\u3042\u308b\u3064\u307e\u305a\u304d\u30dd\u30a4\u30f3\u30c8\u307e\u3067\u3092\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002grep\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3048\u3070\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u6307\u5b9a\u3057\u305f\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u884c\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/strong>\u3053\u306e\u6a5f\u80fd\u306f\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u6271\u3046Linux\u30b5\u30fc\u30d0\u30fc\u306e\u7ba1\u7406\u696d\u52d9\u3001\u7279\u306b\u30ed\u30b0\u89e3\u6790\u3084\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u78ba\u8a8d\u306a\u3069\u3067\u5e83\u304f\u306b\u6d3b\u7528\u3055\u308c\u307e\u3059\u3002grep\u30b3\u30de\u30f3\u30c9\u3092\u4e0a\u624b\u306b\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u30dd\u30a4\u30f3\u30c8\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u306e3\u70b9\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong><span style=\"color: #ff9900;\">\u57fa\u672c\u7684\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u899a\u3048\u3066\u6d3b\u7528\u3059\u308b<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u4ed6\u306e\u30b3\u30de\u30f3\u30c9\u3068\u9023\u643a\u3059\u308b<\/span><\/strong><\/li>\n<li><strong><span style=\"color: #ff9900;\">\u6b63\u898f\u8868\u73fe\u3092\u7406\u89e3\u3057\u3066\u4f7f\u3044\u5206\u3051\u308b<\/span><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u307e\u305a\u306f\u672c\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3001\u57fa\u672c\u7684\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u7406\u89e3\u3057\u3001\u4f7f\u3063\u3066\u307f\u308b\u3053\u3068\u304b\u3089\u59cb\u3081\u3066\u307f\u308b\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2 class=\"styled_h2\"><span id=\"UnixLinuxVPS\">Unix\u3084Linux\u306eVPS\u306a\u3089\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc<\/span><\/h2>\n<p><a href=\"https:\/\/www.miraiserver.ne.jp\/?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=miraiserver\" target=\"_blank\" rel=\"noopener\"><strong>\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc<\/strong><\/a>\u306f\u3001\u30a2\u30b7\u30b9\u30c8\u30a2\u30c3\u30d7\u682a\u5f0f\u4f1a\u793e\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u3001<strong>Unix\u7cfb\u30b5\u30fc\u30d0\u30fc<\/strong>\u306b\u7279\u5316\u3057\u305f\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002<\/p>\n<p><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\"><a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\"><strong>\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u306eVPS<\/strong><\/a>\u3067\u306f\u3001<strong>\u9ad8\u901f\u51e6\u7406\u304c\u53ef\u80fd\u306aSSD<\/strong>\u3092<strong>\u5168\u30d7\u30e9\u30f3\u306b\u642d\u8f09<\/strong>\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">OS\u306f\u3001<b>Ubuntu<\/b>\u3084<b>Debian<\/b>\u3001<b>AlmaLinux<\/b>\u306a\u3069\u306e\u8c4a\u5bcc\u306a\u30e9\u30a4\u30f3\u30a2\u30c3\u30d7\u304b\u3089\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\"><strong>2\u9031\u9593\u7121\u6599\u30c8\u30e9\u30a4\u30a2\u30eb<\/strong><\/a>\u3092\u5b9f\u65bd\u3057\u3066\u304a\u308a\u307e\u3059\u306e\u3067\u3001\u307e\u305a\u306f\u304a\u6c17\u8efd\u306b\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\">\u25bc\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u25bc<\/a><a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-111 size-full\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2022\/08\/02_336x280_a.png\" alt=\"Unix\u7cfbOS\u5c02\u9580\u306e\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u300c\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u300d\" width=\"336\" height=\"280\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2022\/08\/02_336x280_a.png 336w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2022\/08\/02_336x280_a-300x250.png 300w\" sizes=\"(max-width: 336px) 100vw, 336px\" \/><\/a><\/p>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u30d7\u30e9\u30f3\u306e\u9078\u629e\u3067\u304a\u56f0\u308a\u306e\u5834\u5408\u306f\u3001\u305c\u3072\u4e00\u5ea6\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<p style=\"text-align: center;\"><a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/formmail.php?utm_source=btn-vps&amp;utm_medium=referral&amp;utm_campaign=miraiserver\" target=\"_blank\" rel=\"noopener noreferrer\">\u304a\u554f\u3044\u5408\u308f\u305b\u306f\u3053\u3061\u3089<\/a><\/p>\n<div class=\"cardlink\">\r\n    <a class=\"image\" href=\"https:\/\/www.miraiserver.ne.jp\/column\/miraiserver_vps\/\">\r\n     <img src=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2023\/08\/VPS\u306b\u7533\u8fbc\u307f\u3001SSH\u63a5\u7d9a\u3059\u308b\u307e\u3067\u306e\u6d41\u308c\u3010\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3011-2.webp\">\r\n    <\/a>\r\n    <div class=\"content\">\r\n     <div class=\"title_area\">\r\n      <p class=\"date\">2023.08.03<\/p>\r\n      <h4 class=\"title\">\r\n       <a href=\"https:\/\/www.miraiserver.ne.jp\/column\/miraiserver_vps\/\">VPS\u306b\u7533\u8fbc\u307f\u3001SSH\u63a5\u7d9a\u3059\u308b\u307e\u3067\u306e\u6d41\u308c\u3010\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3011<\/a>\r\n      <\/h4>\r\n     <\/div>\r\n     <p class=\"desc\"><span>\u30aa\u30f3\u30e9\u30a4\u30f3\u30d3\u30b8\u30cd\u30b9\u3084Web\u30b5\u30a4\u30c8\u306e\u904b\u55b6\u3092\u59cb\u3081\u308b\u969b\u306b\u306f\u3001\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u306e\u4e2d\u304b\u3089\u81ea\u5206\u306e\u7528\u9014\u306b\u5408\u3063\u305f\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u4e00\u822c\u7684\u3067\u3059\u3002...<\/span><\/p>\r\n    <\/div>\r\n   <\/div>\n\n","protected":false},"excerpt":{"rendered":"Linux\u306egrep\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u7279\u5b9a\u306e\u6587\u5b57\u5217\u3092\u691c\u7d22\u30fb\u62bd\u51fa\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002Linux\u74b0\u5883\u3067\u6700\u3082\u983b\u7e41\u306b\u4f7f\u308f\u308c\u308b\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u3064\u3067\u3042\u308a\u3001\u30ed\u30b0\u89e3\u6790\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30c1\u30a7\u30c3\u30af\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30c7\u30d0\u30c3\u30b0\u306a\u3069\u3001\u3055\u307e\u3056\u307e\u306a\u7528\u9014\u3067\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002\u672c\u8a18\u4e8b\u3067\u306f\u3001grep\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u691c\u7d22\u306e\u4ed5\u65b9\u3001\u3055\u3089\u306b\u306fsed\u3084awk\u3068\u3044\u3063\u305f\u95a2\u9023\u30b3\u30de\u30f3\u30c9\u3068\u306e\u9055\u3044\u307e\u3067\u3001\u521d\u5fc3\u8005\u306e\u65b9\u306b\u3082\u308f\u304b\u308a\u3084\u3059\u304f\u5fb9\u5e95\u89e3\u8aac\u3057\u307e\u3059\u3002 \uff3c 2\u9031\u9593\u7121\u6599\u3067\u304a\u8a66\u3057\u3067\u304d\u307e\u3059\uff01 \uff0f Unix\/Linux\u7cfbVPS\u3092\u3053\u306e\u4fa1\u683c\u3067\uff01 \u30fb\u5168\u30d7\u30e9\u30f3SSD\u642d\u8f09\u3067\u30b3\u30b9\u30c8\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u25ce \u30fb\u8c4a\u5bcc\u306aOS\u30e9\u30a4\u30f3\u30a2\u30c3\u30d7 \u30fb\u5145\u5b9f\u306e\u7121\u6599\u30b5\u30dd\u30fc\u30c8 VPS\u3092\u4f7f\u3063\u3066\u307f\u308b &nbsp; \u76ee\u6b211 grep\u30b3\u30de\u30f3\u30c9\u3068\u306f1.1 grep\u30b3\u30de\u30f3\u30c9\u306e\u5f79\u52721.2 \u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b91.3 \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6d3b\u7528\u3057\u305f\u4fbf\u5229\u306a\u4f7f\u3044\u65b91.4 \u6b63\u898f\u8868\u73fe\u3092\u5229\u7528\u3057\u305f\u4f7f\u3044\u65b92 sed\/awk\u3068\u306e\u9055\u30442.1 grep\/sed\/awk\u306e\u9055\u30442.2 grep\/sed\/awk\u306e\u4f7f\u3044\u5206\u30513 grep\u306e\u30a8\u30e9\u30fc\u5bfe\u7b563.1 \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\uff1aNo such file or directory3.2 \u7d50\u679c\u304c\u306a\u306b\u3082\u8868\u793a\u3055\u308c\u306a\u30444 grep\u306b\u95a2\u3059\u308b\u3088\u304f\u3042\u308b\u8cea\u554f4.1 Q1.grep\u306f\u4f55\u304c\u3067\u304d\u307e\u3059\u304b\uff1f4.2 Q2 grep\u306b\u306f\u3069\u3093\u306a\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u304b\uff1f4.3 Q3 grep\u3067\u62bd\u51fa\u3055\u308c\u308b\u884c\u306e\u884c\u6570\u3092\u51fa\u529b\u3059\u308b\u306b\u306f\uff1f5 \u307e\u3068\u30816 Unix\u3084Linux\u306eVPS\u306a\u3089\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc grep\u30b3\u30de\u30f3\u30c9\u3068\u306f grep\u30b3\u30de\u30f3\u30c9\u306e\u5f79\u5272 grep\u30b3\u30de\u30f3\u30c9\u306f\u3001Linux\u3067\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\uff08\u6a19\u6e96\u5165\u529b\u3092\u542b\u3080\uff09\u304b\u3089\u6307\u5b9a\u3057\u305f\u300c\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u300d\u3068\u4e00\u81f4\u3059\u308b\u884c\u3092\u62bd\u51fa\u3057\u3066\u8868\u793a\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002 \u3010grep\u30b3\u30de\u30f3\u30c9\u306e\u66f8\u5f0f\u3011 grep [\u30aa\u30d7\u30b7\u30e7\u30f3] \u691c\u7d22\u30d1\u30bf\u30fc\u30f3 \u30d5\u30a1\u30a4\u30eb\u540d \u69cb\u6587\u304c\u30b7\u30f3\u30d7\u30eb\u3067\u51e6\u7406\u3082\u8efd\u304f\u3001\u5927\u898f\u6a21\u306a\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3084\u591a\u6570\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3060\u3051\u3092\u52b9\u7387\u3088\u304f\u898b\u3064\u3051\u51fa\u3059\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002 \u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9 grep\u30b3\u30de\u30f3\u30c9\u306e\u57fa\u672c\u7684\u306a\u5f79\u5272\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u5bfe\u8c61\u306b\u3001\u6307\u5b9a\u3057\u305f\u300c\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u300d\u3068\u4e00\u81f4\u3059\u308b\u884c\u3092\u62bd\u51fa\u3057\u3066\u8868\u793a\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u30b7\u30b9\u30c6\u30e0\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\uff08\u4f8b\uff1a\/var\/log\/syslog\uff09\u304b\u3089\u300cStart\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u3080\u884c\u3092\u691c\u7d22\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002 grep \"Start\" \/var\/log\/syslog \u5358\u7d14\u306a\u6587\u5b57\u5217\u3067\u3042\u308c\u3070\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\uff08&#8221; &#8220;\uff09\u3067\u56f2\u307e\u306a\u304f\u3066\u3082\u3088\u3044\u3067\u3059\u3002\u4e00\u65b9\u3001\u30b9\u30da\u30fc\u30b9\u3084\u30b7\u30a7\u30eb\u3067\u7279\u5225\u306a\u610f\u5473\u3092\u6301\u3064\u8a18\u53f7\uff08* \u306a\u3069\uff09\u3092\u542b\u3080\u5834\u5408\u306f\u3001\u610f\u56f3\u3057\u306a\u3044\u5c55\u958b\u3092\u9632\u3050\u305f\u3081\u306b\u5f15\u7528\u7b26\u3067\u56f2\u3080\u306e\u304c\u5b89\u5168\u3067\u3059\u3002\u7279\u306b\u3001\u30b7\u30a7\u30eb\u306b\u3088\u308b\u5f71\u97ff\u3092\u53d7\u3051\u306b\u304f\u3044\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\uff08&#8217; &#8216;\uff09\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6d3b\u7528\u3057\u305f\u4fbf\u5229\u306a\u4f7f\u3044\u65b9 grep\u30b3\u30de\u30f3\u30c9\u306b\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u3001\u76ee\u7684\u306b\u5fdc\u3058\u3066\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u5fc5\u8981\u306a\u60c5\u5831\u3092\u7d20\u65e9\u304f\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002grep\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u3053\u306a\u3059\u7b2c\u4e00\u6b69\u3068\u3057\u3066\u3001\u4ee3\u8868\u7684\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u899a\u3048\u308b\u3053\u3068\u304b\u3089\u59cb\u3081\u3066\u307f\u308b\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002 \u30aa\u30d7\u30b7\u30e7\u30f3 [&hellip;]","protected":false},"author":1,"featured_media":5311,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[188],"tags":[22,456,490,491,492,493,494,495,496],"_links":{"self":[{"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/posts\/5307"}],"collection":[{"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/comments?post=5307"}],"version-history":[{"count":30,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/posts\/5307\/revisions"}],"predecessor-version":[{"id":5346,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/posts\/5307\/revisions\/5346"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/media\/5311"}],"wp:attachment":[{"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/media?parent=5307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/categories?post=5307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/tags?post=5307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}