{"id":1895,"date":"2016-11-15T19:21:19","date_gmt":"2016-11-15T18:21:19","guid":{"rendered":"http:\/\/monodes.com\/predaelli\/?p=1895"},"modified":"2016-11-15T15:21:51","modified_gmt":"2016-11-15T14:21:51","slug":"50-most-frequently-used-unix-linux-commands-with-examples","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2016\/11\/15\/50-most-frequently-used-unix-linux-commands-with-examples\/","title":{"rendered":"50 Most Frequently Used UNIX \/ Linux Commands (With Examples)"},"content":{"rendered":"<p>Several pearl in <em><a href=\"http:\/\/www.gauravkgupta.com\/50-frequently-used-unix-linux-commands-examples\/\">50 Most Frequently Used UNIX \/ Linux Commands (With Examples)<\/a><\/em><\/p>\n<ul>\n<li>Add line number for all non-empty-lines in a file\n<pre>$ sed '\/.\/=' thegeekstuff.txt | sed 'N; s\/\\n\/ \/'<\/pre>\n<\/li>\n<li>Remove duplicate lines using awk\n<pre>$ awk '!($0 in array) { array[$0]; print }' temp\n<\/pre>\n<p>&nbsp;<\/li>\n<li>Print all lines from \/etc\/passwd that has the same uid and gid\n<pre>$awk -F ':' '$3==$4' passwd.txt\n<\/pre>\n<\/li>\n<li>Go to the 143rd line of file\n<pre>$ vim +143 filename.txt\n<\/pre>\n<p>&nbsp;<\/li>\n<li>Go to the first match of the specified\n<pre>$ vim +\/search-term filename.txt\n<\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Several pearl in 50 Most Frequently Used UNIX \/ Linux Commands (With Examples) Add line number for all non-empty-lines in a file $ sed &#8216;\/.\/=&#8217; thegeekstuff.txt | sed &#8216;N; s\/\\n\/ \/&#8217; Remove duplicate lines using awk $ awk &#8216;!($0 in array) { array[$0]; print }&#8217; temp &nbsp; Print all lines from \/etc\/passwd that has the&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2016\/11\/15\/50-most-frequently-used-unix-linux-commands-with-examples\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"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":[72,13],"tags":[],"class_list":["post-1895","post","type-post","status-publish","format-standard","hentry","category-documentations","category-gnulinux"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-uz","jetpack-related-posts":[{"id":7662,"url":"https:\/\/monodes.com\/predaelli\/2020\/10\/05\/advanced-unix-commands-to-boost-your-productivity\/","url_meta":{"origin":1895,"position":0},"title":"Advanced Unix commands to boost your productivity","author":"Paolo Redaelli","date":"2020-10-05","format":"status","excerpt":"Advanced Unix commands to boost your productivity The more you learn the better you get vi or better Vim find awk alias netstat Well, I can say that I do use them all except awk which I usually reimplement poorly using a combination of grep, sed and the like.","rel":"","context":"In &quot;Mood&quot;","block_context":{"text":"Mood","link":"https:\/\/monodes.com\/predaelli\/category\/mood\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11554,"url":"https:\/\/monodes.com\/predaelli\/2024\/04\/03\/how-to-replace-string-in-bash-5-methods-linuxsimply\/","url_meta":{"origin":1895,"position":1},"title":"How to Replace String in Bash? [5 Methods] &#8211; LinuxSimply","author":"Paolo Redaelli","date":"2024-04-03","format":"quote","excerpt":"In bash scripting, the replacement of string is important because it allows you to modify a variable and the text of a file. It also helps in file and text processing and to validate user input. To replace a string in bash, check the following methods: Using Parameter expansion: ${String\/pattern\/replacement}\u2026","rel":"","context":"In &quot;Tricks&quot;","block_context":{"text":"Tricks","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/tricks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6661,"url":"https:\/\/monodes.com\/predaelli\/2020\/02\/09\/how-old-is-your-linux-installation\/","url_meta":{"origin":1895,"position":2},"title":"how old is your linux installation","author":"Paolo Redaelli","date":"2020-02-09","format":false,"excerpt":"I was just wondering how old is my Dell Precision. So I asked DuckDuckGo \"how old is your linux\" and it told me to to read how old is your linux installation on documentacoes.wordpess.com sudo tune2fs -l $( df -h | awk '$NF ~ \"\/$\" {print $1}' ) | grep\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8003,"url":"https:\/\/monodes.com\/predaelli\/2021\/01\/04\/5-lines-i-put-in-a-blank-vimrc-sword-and-signals\/","url_meta":{"origin":1895,"position":3},"title":"5 lines I put in a blank .vimrc | Sword and Signals","author":"Paolo Redaelli","date":"2021-01-04","format":false,"excerpt":"TL;DR To make a default Vim installation more useful, type the following 5 lines into its .vimrc file: set hlsearch \" highlight all search results set ignorecase \" do case insensitive search set incsearch \" show incremental search results as you type set number \" display line number set noswapfile\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3603,"url":"https:\/\/monodes.com\/predaelli\/2017\/12\/28\/vim-8-for-centos-linux-7\/","url_meta":{"origin":1895,"position":4},"title":"Vim 8 for CentOS Linux 7","author":"Paolo Redaelli","date":"2017-12-28","format":"link","excerpt":"Vim 8 for CentOS Linux 7 \u2013 Karanbir Singh :: Thinkability @karan.org Basically add repo https:\/\/copr.fedorainfracloud.org\/coprs\/mcepl\/vim8\/repo\/epel-7\/mcepl-vim8-epel-7.repo","rel":"","context":"In &quot;vim&quot;","block_context":{"text":"vim","link":"https:\/\/monodes.com\/predaelli\/category\/vim\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5064,"url":"https:\/\/monodes.com\/predaelli\/2018\/12\/13\/how-to-force-ssh-client-to-use-only-password-auth-unix-linux-stack-exchange\/","url_meta":{"origin":1895,"position":5},"title":"How to force ssh client to use only password auth? &#8211; Unix &#038; Linux Stack Exchange","author":"Paolo Redaelli","date":"2018-12-13","format":false,"excerpt":"How to force ssh client to use only password auth? - Unix & Linux Stack Exchange ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no example.com","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/1895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=1895"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/1895\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=1895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=1895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=1895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}