{"id":8643,"date":"2021-08-23T22:20:21","date_gmt":"2021-08-23T20:20:21","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/2021\/08\/23\/very-useful-and-not-much-known-linux-commands-that-you-probably-arent-using-in-your-daily-life\/"},"modified":"2021-08-23T22:20:21","modified_gmt":"2021-08-23T20:20:21","slug":"very-useful-and-not-much-known-linux-commands-that-you-probably-arent-using-in-your-daily-life","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2021\/08\/23\/very-useful-and-not-much-known-linux-commands-that-you-probably-arent-using-in-your-daily-life\/","title":{"rendered":"Very useful and not much known Linux commands that you probably aren\u2019t using in your daily life"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">redo the last command but as root<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">sudo !!<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">open an editor to run a command (probably a long one)<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">ctrl + x + e<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">create a super-fast disk for IO dependant task to run on it<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">mkdir -p \/mnt\/ramdisk &amp;&amp; mount -t tmpfs tmpfs \/mnt\/ramdisk -o size=8192M<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">don\u2019t add the command to the history (add one space in front of the command)<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\"> ls -l<br \/>history # check the history<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Fix or change a really long command that you run last with a text editor<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">fc<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">create a tunnel with SSH to port that is not open to the public (local port 8080 -&gt; remote host\u2019s 127.0.0.1 on port 6070)<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">ssh -L 8080:127.0.0.1:6070 root@my-public-server.com -N<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Log output but not show on the console<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">cat somefile | tee -a log.txt | cat &gt; \/dev\/null<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Exit terminal but leave all processes running<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">disown -a &amp;&amp; exit<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Clear your terminal without \u201cclear\u201d command<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">ctrl + l  # L<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Paste the arguments of the previous command<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">alt + -<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Completely clean and clear your terminal<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">reset<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Get CPU info quickly<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">cat \/proc\/cpuinfo<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Get memory info quickly<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">cat \/proc\/meminfo<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Find a text in a directory which has a lot of file in it recursively<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">grep -rn \/etc\/ -e text_to_find<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il gj\">Find files bigger than 100 MB<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">find -type f -size +100MB -exec ls -lah {} \\;<\/pre>\n\n\n\n<p class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii dn gj\" id=\"a7af\">Create a webserver in the current directory to serve files in it<\/p>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">python -m SimpleHTTPServer<\/pre>\n\n\n\n<p class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii dn gj\" id=\"6bd1\">Find your public IP<\/p>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">curl ifconfig.me<\/pre>\n\n\n\n<p class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii dn gj\" id=\"092b\">Get a tree view of folders only 3 level<\/p>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">tree -L 3<\/pre>\n\n\n\n<p class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii dn gj\" id=\"ca33\">Get a tree view of processes<\/p>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">pstree<\/pre>\n\n\n\n<p class=\"hl hm fn hn b ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii dn gj\" id=\"b83c\">Use the last command\u2019s arguments<\/p>\n\n\n\n<pre class=\"wp-block-preformatted im in io ip iq ir is it\">!$<\/pre>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">redo the last command but as root sudo !! open an editor to run a command (probably a long one) ctrl + x + e create a super-fast disk for IO dependant task to run on it mkdir -p \/mnt\/ramdisk &amp;&amp; mount -t tmpfs tmpfs \/mnt\/ramdisk -o size=8192M don\u2019t add the command to the history&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2021\/08\/23\/very-useful-and-not-much-known-linux-commands-that-you-probably-arent-using-in-your-daily-life\/\">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":[1],"tags":[],"class_list":["post-8643","post","type-post","status-publish","format-standard","hentry","category-senza-categoria"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-2fp","jetpack-related-posts":[{"id":6480,"url":"https:\/\/monodes.com\/predaelli\/2020\/01\/25\/advanced-cli-commands-you-should-know-as-a-developer\/","url_meta":{"origin":8643,"position":0},"title":"Advanced CLI: Commands You Should Know as a Developer","author":"Paolo Redaelli","date":"2020-01-25","format":"link","excerpt":"Advanced CLI: Commands You Should Know as a Developer May I feel a little proud when I tell you I know them all? :) Advanced CLI: Commands You Should Know as a Developer Advanced commands; get more done No, in this article we won\u2019t go over the basic commands like\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":10844,"url":"https:\/\/monodes.com\/predaelli\/2023\/10\/07\/how-to-use-the-bg-command-on-linux-pi-my-life-up\/","url_meta":{"origin":8643,"position":1},"title":"How to use the bg Command on Linux &#8211; Pi My Life Up","author":"Paolo Redaelli","date":"2023-10-07","format":false,"excerpt":"Well, I learned a couple of details I didn't knew from How to use the bg Command on Linux - Pi My Life Up How to use the bg Command on Linux by Emmet Published Feb 06, 2022 Linux Commands \u00a0 In this guide, we will be showing you how\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"Emmet Avatar","src":"https:\/\/i0.wp.com\/pimylifeup.com\/wp-content\/uploads\/2022\/04\/pimylifeup_editor_avatar.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":11243,"url":"https:\/\/monodes.com\/predaelli\/2024\/01\/19\/pssh-run-commands-on-multiple-remote-linux-systems\/","url_meta":{"origin":8643,"position":2},"title":"PSSH &#8211; Run Commands on Multiple Remote Linux Systems","author":"Paolo Redaelli","date":"2024-01-19","format":"link","excerpt":"\u00a0PSSH is a small Python-based program, which allows you to execute commands on multiple Linux remote servers in parallel at the same time using the single shell. Source:- Run Commands on Multiple Remote Linux Systems","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":9252,"url":"https:\/\/monodes.com\/predaelli\/2022\/04\/07\/hyperfine\/","url_meta":{"origin":8643,"position":3},"title":"hyperfine","author":"Paolo Redaelli","date":"2022-04-07","format":false,"excerpt":"hyperfine A command-line benchmarking tool. Demo: Benchmarking fd and find: Features Statistical analysis across multiple runs.Support for arbitrary shell commands.Constant feedback about the benchmark progress and current estimates.Warmup runs can be executed before the actual benchmark.Cache-clearing commands can be set up before each timing run.Statistical outlier detection to detect interference\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/monodes.com\/predaelli\/category\/software\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10710,"url":"https:\/\/monodes.com\/predaelli\/2023\/08\/13\/how-to-uninstall-any-android-app-with-adb-including-system-apps-and-bloatware\/","url_meta":{"origin":8643,"position":4},"title":"How to Uninstall Any Android App With ADB (Including System Apps and Bloatware)","author":"Paolo Redaelli","date":"2023-08-13","format":false,"excerpt":"Android phones often come with lots of extra apps installed. If you can't uninstall them normally, you can remove them using the ADB tool. Here's how. Source: How to Uninstall Any Android App With ADB (Including System Apps and Bloatware) How to Uninstall Any Android App With ADB (Including System\u2026","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/monodes.com\/predaelli\/category\/android-2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":315,"url":"https:\/\/monodes.com\/predaelli\/2015\/06\/12\/how-to-make-your-linux-pc-wake-from-sleep-automatically\/","url_meta":{"origin":8643,"position":5},"title":"How to Make Your Linux PC Wake From Sleep Automatically","author":"Paolo Redaelli","date":"2015-06-12","format":false,"excerpt":"From How to Make Your Linux PC Wake From Sleep Automatically I use sudo rtcwake -m\u00a0mem -l -t $(date +%s -d \u2018tomorrow 06:30\u2019) or sudo \/usr\/sbin\/rtcwake -m mem -s $(( 8 * 3600)) Want to put your Linux PC into sleep or hibernate mode and have it automatically wake at\u2026","rel":"","context":"In &quot;GNU\/Linux&quot;","block_context":{"text":"GNU\/Linux","link":"https:\/\/monodes.com\/predaelli\/category\/gnulinux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/image101.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/image101.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/image101.png?resize=525%2C300 1.5x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/8643","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=8643"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/8643\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=8643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=8643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=8643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}