{"id":9313,"date":"2023-09-24T11:34:43","date_gmt":"2023-09-24T09:34:43","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=9313"},"modified":"2023-09-24T11:34:45","modified_gmt":"2023-09-24T09:34:45","slug":"vgrep-textdateien-unter-linux-uebersichtlicher-durchsuchen","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2023\/09\/24\/vgrep-textdateien-unter-linux-uebersichtlicher-durchsuchen\/","title":{"rendered":"vgrep &#8211; Textdateien unter Linux \u00fcbersichtlicher durchsuchen"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Unter normalen Umst\u00e4nden durchsucht man unter Linux am Terminal Textdateien mit dem Befehl <code>grep<\/code> &#8211; etwa:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -i bash *<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grep.jpeg\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"741\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grep-1024x741.jpeg\" alt=\"\" class=\"wp-image-9314\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grep-1024x741.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grep-300x217.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grep-150x109.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grep-768x556.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grep-1536x1112.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grep.jpeg 1650w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Die Ausgabe ist wohl vor allem f\u00fcr Einsteiger etwas un\u00fcbersichtlich, die Software <strong>vgrep<\/strong> bereitet die Ausgabe um einiges \u00fcbersichtlicher auf.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">vgrep installieren<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sie finden diese Software auf <a href=\"https:\/\/github.com\/vrothberg\/vgrep\/releases\">GitHub<\/a> zum Download, die heruntergeladene Datei benennen Sie der Einfachheit um &#8211; etwa gleich am Terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv vgrep_2.6.1_Linux_x86_64 vgrep<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Anschlie\u00dfend machen Sie die Datei ausf\u00fchrbar:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x vgrep<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Zuletzt verschieben Sie die Datei als root auf dem Terminal nach &#8222;<em>\/usr\/bin<\/em>&#8222;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv vgrep \/usr\/bin\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">vgrep nutzen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>vgrep<\/code> wird genauso, wie auch <code>grep<\/code> genutzt &#8211; im Beispiel wie oben also:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vgrep -i bash .*<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-scaled.jpeg\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"435\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1024x435.jpeg\" alt=\"\" class=\"wp-image-9315\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1024x435.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-300x127.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-150x64.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-768x326.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1536x652.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-2048x869.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Die Software \u00fcbergibt die Ausgabe an den Befehl <code>less<\/code> &#8211; darum, m\u00fcssen Sie. Um alles zu sehen, mit der <kbd>Pfeiltaste<\/kbd> (rechts) nach rechts scrollen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1-scaled.jpeg\" rel=\"lightbox-2\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"432\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1-1024x432.jpeg\" alt=\"\" class=\"wp-image-9316\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1-1024x432.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1-300x127.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1-150x63.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1-768x324.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1-1536x648.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-1-2048x864.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ganz links wird der Dateiname in Blau angezeigt, rechts in Gr\u00fcn die Zeile, in der, der gesuchte Begriff gefunden wird und anschlie\u00dfend die Zeile als Text selbst, der gesuchte Begriff in Rot. Mit <kbd>q<\/kbd> beenden Sie <code>less<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mit der Option <code>--interactive<\/code> erhalten Sie eine minimale Shell, hier lassen Sie sich mit <kbd>?<\/kbd> alle Befehle anzeigen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-2.jpeg\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"292\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-2-1024x292.jpeg\" alt=\"\" class=\"wp-image-9317\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-2-1024x292.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-2-300x85.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-2-150x43.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-2-768x219.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vgrep-2.jpeg 1482w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit <kbd>q<\/kbd> beenden Sie die Shell von <code>vgrep<\/code>.<\/p>\n<div class=\"pld-like-dislike-wrap pld-custom\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir\" data-post-id=\"9313\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Hoch.png\" alt=\"Gef\u00e4llt mir\" \/>\r\n            <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir nicht\" data-post-id=\"9313\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Runter.png\" alt=\"Gef\u00e4llt mir nicht\" \/>\r\n            <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Unter normalen Umst\u00e4nden durchsucht man unter Linux am Terminal Textdateien mit dem Befehl grep &#8211; etwa: Die Ausgabe ist wohl vor allem f\u00fcr Einsteiger etwas un\u00fcbersichtlich, die Software vgrep bereitet die Ausgabe um einiges \u00fcbersichtlicher auf. vgrep installieren Sie finden diese Software auf GitHub zum Download, die heruntergeladene Datei benennen Sie der Einfachheit um &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9316,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[12,7,6],"class_list":["post-9313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-terminal","tag-kommandozeile","tag-shell","tag-terminal"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/9313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=9313"}],"version-history":[{"count":1,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/9313\/revisions"}],"predecessor-version":[{"id":9318,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/9313\/revisions\/9318"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/9316"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=9313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=9313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=9313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}