{"id":76438,"date":"2024-12-08T01:44:56","date_gmt":"2024-12-08T01:44:56","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=76438"},"modified":"2024-12-08T01:44:57","modified_gmt":"2024-12-08T01:44:57","slug":"linux-sed-search-replace-delete-print","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76438","title":{"rendered":"Linux: sed: search, replace, delete, print"},"content":{"rendered":"\n<p><strong>Word Replace<\/strong><\/p>\n\n\n\n<p>&nbsp;sed &#8216;s\/root\/amrood\/\u2019<\/p>\n\n\n\n<p>&nbsp;sed &#8216;s\/root\/amrood\/g\u2019<\/p>\n\n\n\n<p>&nbsp;sed &#8216;s\/root\/amrood\/&#8217; | grep root<\/p>\n\n\n\n<p>&nbsp;sed &#8216;s\/root\/amrood\/g&#8217; | grep root<\/p>\n\n\n\n<p>cat \/etc\/passwd | sed &#8216;s\/root\/\/g&#8217;<\/p>\n\n\n\n<p><strong>Delete Lines in the Output<\/strong><\/p>\n\n\n\n<p>cat \/etc\/passwd | sed &#8216;1, 5d&#8217; |more<\/p>\n\n\n\n<p>cat \/etc\/passwd | head<\/p>\n\n\n\n<p>cat \/etc\/passwd | sed &#8216;1d&#8217; | head<\/p>\n\n\n\n<p>cat \/etc\/passwd | grep &#8216;sh$\u2019<\/p>\n\n\n\n<p>cat \/etc\/passwd | sed &#8216;\/sh$\/d&#8217;<\/p>\n\n\n\n<p>Print:<\/p>\n\n\n\n<p>cat \/etc\/passwd | sed -n &#8216;\/root\/p&#8217;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Word Replace &nbsp;sed &#8216;s\/root\/amrood\/\u2019 &nbsp;sed &#8216;s\/root\/amrood\/g\u2019 &nbsp;sed &#8216;s\/root\/amrood\/&#8217; | grep root &nbsp;sed &#8216;s\/root\/amrood\/g&#8217; | grep root cat \/etc\/passwd | sed &#8216;s\/root\/\/g&#8217; Delete Lines in the Output cat \/etc\/passwd | sed &#8216;1, 5d&#8217; |more cat \/etc\/passwd | head cat \/etc\/passwd | sed &#8216;1d&#8217; | head cat \/etc\/passwd | grep &#8216;sh$\u2019 cat \/etc\/passwd | sed &#8216;\/sh$\/d&#8217; Print: &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=76438\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-76438","post","type-post","status-publish","format-standard","hentry","category-root","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":9650,"url":"http:\/\/bangla.sitestree.com\/?p=9650","url_meta":{"origin":76438,"position":0},"title":"\u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8 &#8211; SED \u098f\u09b0 \u09b8\u09be\u09a5\u09c7 \u09b0\u09c7\u0997\u09c1\u09b2\u09be\u09b0 \u098f\u0995\u09cd\u09b8\u09aa\u09cd\u09b0\u09c7\u09b6\u09a8 (Unix &#8211; Regular Expressions with SED)","author":"Author-Check- Article-or-Video","date":"July 9, 2015","format":false,"excerpt":"\u09b0\u09bf\u09a6\u0993\u09df\u09be\u09a8 \u09ac\u09bf\u09a8 \u09b6\u09be\u09ae\u09c0\u09ae \u00a0 \u0986\u099c\u0995\u09c7\u09b0 \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2\u09c7 \u0986\u09ae\u09b0\u09be \u09a6\u09c7\u0996\u09ac \u0995\u09c0\u09ad\u09be\u09ac\u09c7 sed \u09a4\u09c7 \u09b0\u09c7\u0997\u09c1\u09b2\u09be\u09b0 \u098f\u0995\u09cd\u09b8\u09aa\u09cd\u09b0\u09c7\u09b6\u09a8 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09be \u09b9\u09df\u0964 \u00a0 \u098f\u09b8\u0987\u09a1\u09bf\u0995\u09c7 \u0987\u09a8\u09ad\u09cb\u0995 \u0995\u09b0\u09be \u09aa\u09be\u0987\u09aa\u09c7\u09b0 \u09ae\u09be\u09a7\u09cd\u09af\u09ae\u09c7 \u098f\u09b8\u0987\u09a1\u09bf\u09a4\u09c7 \u09a1\u09be\u099f\u09be \u09aa\u09cd\u09b0\u09c7\u09b0\u09a3 \u0995\u09b0\u09c7 \u098f\u0995\u09c7 \u0987\u09a8\u09ad\u09cb\u0995 \u0995\u09b0\u09be \u09af\u09be\u09df, $ cat \/etc\/passwd | sed Usage: sed [OPTION]... {script-other-script} [input-file]... \u00a0 \u00a0 -n, --quiet, --silent \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 suppress automatic printing of\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76440,"url":"http:\/\/bangla.sitestree.com\/?p=76440","url_meta":{"origin":76438,"position":1},"title":"Linux sed, cat, cut examples","author":"Sayed","date":"December 8, 2024","format":false,"excerpt":"cut -d \":\" -f 1,3 \/etc\/passwd echo $aLine | cut -d \":\" -f 1,3 cat \/etc\/passwd | cut -d \":\" -f1,3","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/12\/image-33.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/12\/image-33.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/12\/image-33.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/12\/image-33.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/12\/image-33.png?resize=1050%2C600 3x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/12\/image-33.png?resize=1400%2C800 4x"},"classes":[]},{"id":9544,"url":"http:\/\/bangla.sitestree.com\/?p=9544","url_meta":{"origin":76438,"position":2},"title":"\u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8 : \u09b6\u09c1\u09b0\u09c1\u09b0 \u0995\u09a5\u09be (Unix &#8211; Getting Started)","author":"Author-Check- Article-or-Video","date":"June 26, 2015","format":false,"excerpt":"\u09b0\u09bf\u09a6\u0993\u09df\u09be\u09a8 \u09ac\u09bf\u09a8 \u09b6\u09be\u09ae\u09c0\u09ae \u00a0 \u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0995\u09bf ? \u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0985\u09aa\u09be\u09b0\u09c7\u099f\u09bf\u0982 \u09b8\u09bf\u09b8\u09cd\u099f\u09c7\u09ae \u09b9\u09b2 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09c7\u09b0 \u098f\u0995\u099f\u09bf \u09b8\u09c7\u099f \u09af\u09be \u0995\u09ae\u09cd\u09aa\u09bf\u0989\u099f\u09be\u09b0 \u0993 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u0995\u09be\u09b0\u09c0\u09b0 \u09ae\u09a7\u09cd\u09af\u09c7 \u09b2\u09bf\u0999\u09cd\u0995 \u09b9\u09bf\u09b8\u09c7\u09ac\u09c7 \u0995\u09be\u099c \u0995\u09b0\u09c7\u0964 \u098f\u09a4\u09c7 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u0995\u09be\u09b0\u09c0 \u09b8\u09c7\u09b2 \u09a8\u09be\u09ae\u09c7\u09b0 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09c7\u09b0 \u09ae\u09be\u09a7\u09cd\u09af\u09ae\u09c7 \u0995\u09be\u09b0\u09cd\u09a8\u09c7\u09b2\u09c7 \u09af\u09cb\u0997\u09be\u09af\u09cb\u0997 \u0995\u09b0\u09c7\u0964 \u09b8\u09c7\u09b2 \u09b9\u09b2 \u0995\u09ae\u09cd\u09af\u09be\u09a8\u09cd\u09a1 \u09b2\u09be\u0987\u09a8 \u0987\u09a8\u09cd\u099f\u09be\u09b0\u09aa\u09cd\u09b0\u09bf\u099f\u09be\u09b0, \u098f\u099f\u09bf \u0987\u0989\u099c\u09be\u09b0\u09c7\u09b0 \u0995\u09ae\u09cd\u09af\u09be\u09a8\u09cd\u09a1 \u0985\u09a8\u09c1\u09ac\u09be\u09a6 \u0995\u09b0\u09c7 \u0995\u09be\u09b0\u09cd\u09a8\u09c7\u09b2\u09c7\u09b0 \u09aa\u09be\u09a0\u09af\u09cb\u0997\u09cd\u09af \u09ad\u09be\u09b7\u09be\u09df \u09aa\u09b0\u09bf\u09ac\u09b0\u09cd\u09a4\u09a8 \u0995\u09b0\u09c7\u0964 \u09e7\u09ef\u09ec\u09ef \u09b8\u09be\u09b2\u09c7 \u098f\u099f\u09bf\u098f\u09a8\u09cd\u09a1\u099f\u09bf\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"\u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8\u09c7\u09b0 \u0995\u09be\u09a0\u09be\u09ae\u09cb","src":"https:\/\/i0.wp.com\/www.tutorialspoint.com\/unix\/images\/unix_architecture.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":14036,"url":"http:\/\/bangla.sitestree.com\/?p=14036","url_meta":{"origin":76438,"position":3},"title":"Users and Groups management in Linux (Redhat\/CentOS\/Fedora)","author":"Sayed","date":"December 25, 2017","format":false,"excerpt":"Users and Groups management in Linux (Redhat\/CentOS\/Fedora) Target Audience: Technical people who knew or already know (to some extent) - just wanna review Yes, from my history 622 echo \"dec 25th, 2017 - sayed\" \u00a0 User and password related files 623 cat \/etc\/passwd 624 cat \/etc\/shadow 625 cat \/etc\/group 626\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9585,"url":"http:\/\/bangla.sitestree.com\/?p=9585","url_meta":{"origin":76438,"position":4},"title":"\u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8\u0983 \u09ab\u09be\u0987\u09b2 \u09aa\u09be\u09b0\u09ae\u09bf\u09b6\u09a8 \u0993 \u098f\u0995\u09cd\u09b8\u09c7\u09b8 \u09ae\u09cb\u09a1 (Unix &#8211; File Permission \/ Access Modes)","author":"Author-Check- Article-or-Video","date":"June 29, 2015","format":false,"excerpt":"\u09b0\u09bf\u09a6\u0993\u09df\u09be\u09a8 \u09ac\u09bf\u09a8 \u09b6\u09be\u09ae\u09c0\u09ae \u00a0 \u09ab\u09be\u0987\u09b2 \u0993\u09a8\u09be\u09b0\u09b6\u09bf\u09aa \u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8\u09c7\u09b0 \u098f\u0995\u099f\u09bf \u0997\u09c1\u09b0\u09c1\u09a4\u09cd\u09ac\u09aa\u09c2\u09b0\u09cd\u09a3 \u0989\u09aa\u09be\u09a6\u09be\u09a8 \u09af\u09be \u09ab\u09be\u0987\u09b2 \u09b7\u09cd\u099f\u09cb\u09b0\u09c7\u09b0 \u09a8\u09bf\u09b0\u09be\u09aa\u09a6 \u0989\u09aa\u09be\u09df \u09b9\u09bf\u09b8\u09c7\u09ac\u09c7 \u09aa\u09cd\u09b0\u09df\u09cb\u099c\u09a8\u0964 \u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8\u09c7\u09b0 \u09aa\u09cd\u09b0\u09a4\u09cd\u09af\u09c7\u0995\u099f\u09bf \u09ab\u09be\u0987\u09b2\u09c7 \u09af\u09c7 \u098f\u099f\u09cd\u09b0\u09bf\u09ac\u09bf\u0989\u099f\u0997\u09c1\u09b2\u09cb \u09a5\u09be\u0995\u09c7 \u09b8\u09c7\u0997\u09c1\u09b2\u09cb \u09b9\u09b2, \u0993\u09a8\u09be\u09b0\u09c7\u09b0 \u09aa\u09be\u09b0\u09ae\u09bf\u09b6\u09a8, \u0997\u09cd\u09b0\u09c1\u09aa \u09aa\u09be\u09b0\u09ae\u09bf\u09b6\u09a8, \u0985\u09a8\u09cd\u09af\u09be\u09a8\u09cd\u09af \u09aa\u09be\u09b0\u09ae\u09bf\u09b6\u09a8 \u00a0 \u09aa\u09be\u09b0\u09ae\u09bf\u09b6\u09a8 \u0987\u09a8\u09a1\u09bf\u0995\u09c7\u099f\u09b0 ls -l \u0995\u09ae\u09cd\u09af\u09be\u09a8\u09cd\u09a1 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c7 \u09aa\u09be\u09b0\u09ae\u09bf\u09b6\u09a8 \u09b8\u0982\u0995\u09cd\u09b0\u09be\u09a8\u09cd\u09a4 \u0985\u09a8\u09c7\u0995 \u09a4\u09a5\u09cd\u09af \u09a6\u09c7\u0996\u09be \u09af\u09be\u09df, $ls -l \/home\/amrood -rwxr-xr-- 1\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14846,"url":"http:\/\/bangla.sitestree.com\/?p=14846","url_meta":{"origin":76438,"position":5},"title":"Learn some CentOS Linux : Redhat Linux","author":"Sayed","date":"June 29, 2019","format":false,"excerpt":"This is mostly about Centos Linux. However, this also shows commands related to how to install Magento 2 on LEMP (E for Nginx Web-server). Some PHP related stuff are there as well. LEMP + CentOS + Magento 2 : VM Image or one click install: I did not see readily\u2026","rel":"","context":"In &quot;Magento 2&quot;","block_context":{"text":"Magento 2","link":"http:\/\/bangla.sitestree.com\/?cat=1907"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76438"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76438\/revisions"}],"predecessor-version":[{"id":76439,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76438\/revisions\/76439"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76438"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}