<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>linux &amp;mdash; SciTech</title>
    <link>https://qua.name/scitech/tag:linux</link>
    <description></description>
    <pubDate>Sat, 16 May 2026 11:47:08 +0200</pubDate>
    <item>
      <title>Commands in new format</title>
      <link>https://qua.name/scitech/new-commands</link>
      <description>&lt;![CDATA[Cheat sheets: muo Vim | vim | tldr simpler man pages | find | find dev.to | awk | awk quickref | htg awk | lxe awk | awk in 20 | sed | sed, htg | 13 CLI cmds | dig | netstat cmds | html | bash alias: function ct { curl cheat.sh\/&#34;$1&#34;; } | on github |&#xA;CLI articles |!--more--&#xA;&#xA;apachectl sudo apache2ctl -M   (show all loaded modules) | sudo apache2ctl -D DUMPRUNCFG | sudo apache2ctl -D DUMPVHOSTS | sudo apache2ctl -S  (show parsed VHost settings) | sudo apachectl -t  (apache config test) |&#xA;apt    apt-cache search php7.3 |  apt-cache show php7.3 &#xA;install pkgs &#34;kept back&#34;: sudo apt-get dist-upgrade | sudo apt-get --with-new-pkgs upgrade |&#xA;Clean up partial package: sudo apt autoclean&#xA;Clean up apt cache: sudo apt-get clean&#xA;Clean up unused dependencies: sudo apt autoremove&#xA;Uninstall application: sudo apt autoremove application-name&#xA; apt list --installed | grep &#34; installed&#34; /var/log/dpkg.log (also log.1) | apt show pkg | apt purge unneeded package |  sudo apt-mark showhold | sudo apt-mark unhold packagename | sudo apt autoremove | sudo apt autoclean |&#xA;sudo apt-get remove --purge $(dpkg -l | grep &#34;^rc&#34; | awk &#39;{print $2}&#39;) markremove rc residual packages/mark&#xA;awk   awk &#39;{print $5}&#39; | grep -Eo &#39;([0-9]{1,3}\.){3}[0-9]{1,3}&#39;| sort &#xA;cat   cat paperstoread.htm | sort | cut -c 1-50 | uniq -d (find duplicate lines)&#xA;chmod   chmod --reference=referencefile file [f2 f3] | chown chown --reference=referencefile file [f2]f3 |&#xA;comm   comm -12 &lt;(sort file1.txt) &lt;(sort file2.txt) find common lines in two files&#xA;cp   sudo cp -p pedit.html blogview.html cp -rp doc] | [cp preserving ownership, permissions &#xA;curl   curl cheat.sh/find | curl ifconfig.io | curl ipinfo.io | curl http://ipv4.icanhazip.com or curl http://icanhazip.com or curl http://ip.fossdaily.xyz | curl --ssl | curl --insecure | curl -I http://domain.com (headers info) | article | curl cookbook |&#xA;dig  dig example.com ANY +noall +answer&#xA;dpkg dpkg -l | grep &#34;^rc&#34; | sudo apt-get remove --purge $(dpkg -l | grep &#34;^rc&#34; | awk &#39;{print $2}&#39;)&#xA;find   find . -maxdepth 1 -type f -name &#34;.md&#34; -exec ls -al {} \; | find /tmp -type f -name &#34;.htaccess&#34; -exec grep -EHi &#39;(Redirect|RewriteRule)&#39; {} \; | find . -type f -perm 777 -exec chmod 644 {} \; | find /home -type d -perm -o+w -exec ls -ld {} \;  find world-writable directories in /home&#xA;gpg   gpg --output outfile.gpg --symmetric --cipher-algo AES256 file.ext |  gpg -o originalfile.txt -d file.txt.gpg |&#xA;grep   grep -Eri &#39;(Redirect|RewriteRule)&#39; /etc/apache2/&#xA;iptables sudo iptables -L | sudo iptables-save   iptables.rules | sudo iptables-restore &lt;iptables.rules | ubuntu iptables doc |&#xA;journalctl   journalctl -u ssh.service | journalctl -u network.service | journalctl article | &#xA;ls ls -H (follow symbolic links) | ls -Al | tr -s &#39; &#39; | cut -f9- -d&#39; &#39; (list just file and folder names; -R for dir recursion)&#xA;netstat   netstat -tulpn | netstat -npl | netstat -tulpn | netstat -npl | netstat -plane | grep :80 | awk &#39;{print $5}&#39; | grep -Eo &#39;([0-9]{1,3}\.){3}[0-9]{1,3}&#39; | sort | uniq -c | sort -n  conn port 80&#xA;perl   perl -pi -e &#39;s,RoseHosting,BestManagedVPS&#39; file.php Replace all string instances w/o opening file w text editor&#xA;pscp pscp -agent -i keyfile -P port (-agent is for pageant)&#xA;sed   sed -e &#34;s/\r//g&#34; file   newfile remove newline chars from file | sed -i &#39;s/search/repace/g&#39; .php  replace string in all specified files |&#xA;systemctl   sudo systemctl restart apache2 | sudo systemctl -a | sudo systemctl --state active | sudo systemctl list-timers | sudo systemctl list-unit-files | sudo systemctl list-unit-files | grep -i docker |&#xA;sudo systemctl | grep running (list running services) | sudo systemctl list-unit-files | grep enabled  (list enabled services) |&#xA;sudo systemctl reload ssh.service | systemctl list-unit-files --type=service | systemctl list-dependencies graphical.target | article | sudo systemctl enable apache2 | sudo systemctl disable apache2 | sudo systemctl is-enabled apache2 | article |&#xA;tar   tar -cvzf archive-name.tar.gz directory-name |  tar -C /diff-folder -xvf yourfile.tar to extract to a different directory |&#xA;timedatectl   timedatectl | Bash date to/from unix epoch time: date +%s | date -d @unix epoch time |&#xA;vim :w !sudo tee % |  :set ignorecase |  :set ff=unix or :set ff=dos | :set number or :set nonumber | :nohl |&#xA;&#xA;df -h | df -T &#xA;du -sh&#xA;dpkg-query -L package name   (list files in package)&#xA;faillog | free |&#xA;history -c&#xA;host ipaddr|domain  (Cloud Shell: get ip addr for domain or domain for ip addr, etc)&#xA;hostnamectl status&#xA;id username&#xA;sudo iptables -L -nv --line-numbers | sudo iptables-restore &lt; /etc/iptables/rules.v4 |&#xA;lastlog | last&#xA;sudo lshw&#xA;sudo sshd -T | /etc/ssh/sshd\config | ssh security hardening |&#xA;lsb&amp;lowbar;release -a | cat /proc/version&#xA;wget --no-check-certificate&#xA;whatis&#xA;zgrep -E &#34;^(Remove:|Purge)&#34; /var/log/apt/history.log&#xA;sudo -u www-data php occ app:list&#xA;zip -d gallery.zip &#34;picture439.jpg&#34;  (delete file from zip, note zip goes first, followed by file)&#xA;&#xA;gcloud info | gcloud version |&#xA;Windows: netstat | findstr ESTABLISHED&#xA;&#xA;Replace string recursively with find and sed&#xA;Remove all dpkg rc residual packages&#xA;&#xA;delete every line until PATTERN, that line included: cat index.html | sed &#39;1,/body onload/d&#39;&#xA;print (p) from the first line matching PATTERN to the end ($): cat index.html | sed -n &#39;/body onload/,$p&#39;&#xA;&#xA;Which Linux distro is running: cat /etc/-release&#xA;&#xA;101 Bash Commands | Text Processing in the Shell |&#xA;a href=&#34;https://towardsdatascience.com/mastering-file-and-text-manipulation-with-awk-utility-65fc09d56bef&#34;Mastering File And Text Manipulation With Awk Utility/a&#xA;&#xA;dpkg queries:&#xA;&#xA;-l, --list package-name-pattern...&#xA;    List packages matching given pattern.&#xA;-s, --status package-name...&#xA;    Report status of specified package.&#xA;-L, --listfiles package-name...&#xA;    List files installed to your system from package-name.&#xA;-S, --search filename-search-pattern...&#xA;    Search for a filename from installed packages.&#xA;-p, --print-avail package-name...&#xA;    On debian/ubuntu, use instead: apt-cache show package-name&#xA;    Display details about package-name, as found in /var/lib/dpkg/available. &#xA;Useful network commands, labnol&#xA;Basic regex in javascript&#xA;&#xA;/etc/alternatives (e.g., php cli version, check vs apache version)&#xA;&#xA;what process(es) are running for port 443: sudo lsof -t -i:443&#xA;&#xA;journalctl -- query the systemd journal.&#xA;Systemd has its own logging system called the journal.  To read those logs, journalctl is used. &#xA;The journal (journald) stores log data in binary format, unlike past services that stored logs in plain text. As such, journalctl is used to transmute binary logs into readable plain text. Check out The ultimate guide to using journalctl.&#xA;Another good read is kmsg. Kmsg (/dev/kmsg) is a file stored in the Linux filesystem, used to store messages from the Kernel, and is used by dmesg and klogd.&#xA;&#xA;a href=&#34;https://haydenjames.io/linux-commands-frequently-used-by-linux-sysadmins-part-5/&#34;Linux Commands frequently used by Linux Sysadmins – Part 5/a&#xA;&#xA;a href=&#34;https://dev.to/shaikh/how-to-manage-background-processes-in-linux-1d2m&#34;How to manage background processes in Linux/a&#xA;&#xA;cheatsheet for ip commands #network #linux&#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Cheat sheets: <a href="https://www.makeuseof.com/tag/vim-shortcuts-cheat-sheet/" rel="nofollow">muo Vim</a> | <a href="https://vim.rtorr.com/" rel="nofollow">vim</a> | <a href="https://tldr.fossdaily.xyz/" rel="nofollow">tldr simpler man pages</a> | <a href="http://www.grymoire.com/Unix/Find.html" rel="nofollow">find</a> | <a href="https://dev.to/yashsugandh/finding-files-and-directories-in-linux-system-hlc" rel="nofollow">find dev.to</a> | <a href="http://www.grymoire.com/Unix/Awk.html" rel="nofollow">awk</a> | <a href="http://www.grymoire.com/Unix/AwkRef.html" rel="nofollow">awk quickref</a> | <a href="https://www.howtogeek.com/562941/how-to-use-the-awk-command-on-linux/" rel="nofollow">htg awk</a> | <a href="https://linuxize.com/post/awk-command/" rel="nofollow">lxe awk</a> | <a href="https://ferd.ca/awk-in-20-minutes.html" rel="nofollow">awk in 20</a> | <a href="http://www.grymoire.com/Unix/Sed.html" rel="nofollow">sed</a> | <a href="https://www.howtogeek.com/666395/how-to-use-the-sed-command-on-linux" rel="nofollow">sed, htg</a> | <a href="https://www.maketecheasier.com/working-with-text-on-linux-command-line/" rel="nofollow">13 CLI cmds</a> | <a href="https://www.howtogeek.com/663056/how-to-use-the-dig-command-on-linux/" rel="nofollow">dig</a> | <a href="https://geekflare.com/netstat-command-usage-on-windows/" rel="nofollow">netstat cmds</a> | <a href="https://www.makeuseof.com/tag/html-cheat-sheet/" rel="nofollow">html</a> | bash alias: <code>function ct { curl cheat.sh\/&#34;$1&#34;; }</code> | <a href="https://github.com/chubin/cheat.sh" rel="nofollow">on github</a> |
<a href="https://opensource.com/tags/command-line" rel="nofollow">CLI articles</a> |</p>

<p><strong>apachectl</strong> <code>sudo apache2ctl -M</code>   (show all loaded modules) | <code>sudo apache2ctl -D DUMP_RUN_CFG</code> | <code>sudo apache2ctl -D DUMP_VHOSTS</code> | <code>sudo apache2ctl -S</code>  (show parsed VHost settings) | <code>sudo apachectl -t</code>  (apache config test) |
<strong>apt</strong>   <code>apt-cache search php7.3</code> | <code>apt-cache show php7.3</code>
install pkgs “kept back”: <code>sudo apt-get dist-upgrade</code> | <code>sudo apt-get --with-new-pkgs upgrade</code> |
Clean up partial package: <code>sudo apt autoclean</code>
Clean up apt cache: <code>sudo apt-get clean</code>
Clean up unused dependencies: <code>sudo apt autoremove</code>
Uninstall application: <code>sudo apt autoremove application-name</code>
<code>apt list --installed</code> | <code>grep &#34; installed&#34; /var/log/dpkg.log</code> (also log.1) | <code>apt show &lt;pkg&gt;</code> | <code>apt purge &lt;unneeded package&gt;</code> | <code>sudo apt-mark showhold</code> | <code>sudo apt-mark unhold package_name</code> | <code>sudo apt autoremove</code> | <code>sudo apt autoclean</code> |
<code>sudo apt-get remove --purge $(dpkg -l | grep &#34;^rc&#34; | awk &#39;{print $2}&#39;)</code> <mark>remove rc residual packages</mark>
<strong>awk</strong>   <code>awk &#39;{print $5}&#39; | grep -Eo &#39;([0-9]{1,3}\.){3}[0-9]{1,3}&#39;| sort</code>
<strong>cat</strong>   <code>cat papers_to_read.htm | sort | cut -c 1-50 | uniq -d</code> (find duplicate lines)
<strong>chmod</strong>   <code>chmod --reference=reference_file file [f2 f3]</code> | <strong>chown</strong> <code>chown --reference=reference_file file [f2]f3</code> |
<strong>comm</strong>   <code>comm -12 &lt;(sort file1.txt) &lt;(sort file2.txt)</code> find common lines in two files
<strong>cp</strong>   <code>sudo cp -p pedit.html blogview.html</code> [cp -rp doc] | <a href="https://fabianlee.org/2018/10/15/linux-copy-a-directory-preserving-ownership-permissions-and-modification-date/" rel="nofollow">cp preserving ownership, permissions</a>
<strong>curl</strong>   <code>curl cheat.sh/find</code> | <code>curl ifconfig.io</code> | <code>curl ipinfo.io</code> | <code>curl http://ipv4.icanhazip.com</code> or <code>curl http://icanhazip.com</code> or <code>curl http://ip.fossdaily.xyz</code> | <code>curl --ssl</code> | <code>curl --insecure</code> | <code>curl -I http://domain.com</code> (headers info) | <a href="https://opensource.com/article/20/5/curl-cheat-sheet" rel="nofollow">article</a> | <a href="https://catonmat.net/cookbooks/curl" rel="nofollow">curl cookbook</a> |
<strong>dig</strong>  <code>dig example.com ANY +noall +answer</code>
<strong>dpkg</strong> <code>dpkg -l | grep &#34;^rc&#34;</code> | <code>sudo apt-get remove --purge $(dpkg -l | grep &#34;^rc&#34; | awk &#39;{print $2}&#39;)</code>
<strong>find</strong>   <code>find . -maxdepth 1 -type f -name &#34;*.md&#34; -exec ls -al {} \;</code> | <code>find /tmp -type f -name &#34;.htaccess&#34; -exec grep -EHi &#39;(Redirect|RewriteRule)&#39; {} \;</code> | <code>find . -type f -perm 777 -exec chmod 644 {} \;</code> | <code>find /home -type d -perm -o+w -exec ls -ld {} \;</code>  find world-writable directories in /home
<strong>gpg</strong>   <code>gpg --output outfile.gpg --symmetric --cipher-algo AES256 file.ext</code> |  <code>gpg -o original_file.txt -d file.txt.gpg</code> |
<strong>grep</strong>   <code>grep -Eri &#39;(Redirect|RewriteRule)&#39; /etc/apache2/</code>
<strong>iptables</strong> <code>sudo iptables -L</code> | <code>sudo iptables-save &gt;iptables.rules</code> | <code>sudo iptables-restore &lt;iptables.rules</code> | <a href="https://help.ubuntu.com/community/IptablesHowTo" rel="nofollow">ubuntu iptables doc</a> |
<strong>journalctl</strong>   <code>journalctl -u ssh.service | journalctl -u network.service</code> | <a href="https://www.howtogeek.com/499623/how-to-use-journalctl-to-read-linux-system-logs/" rel="nofollow">journalctl article</a> |
<strong>ls</strong> <code>ls -H</code> (follow symbolic links) | <code>ls -Al | tr -s &#39; &#39; | cut -f9- -d&#39; &#39;</code> (list just file and folder names; -R for dir recursion)
<strong>netstat</strong>   <code>netstat -tulpn | netstat -npl</code> | <code>netstat -tulpn | netstat -npl</code> | <code>netstat -plane | grep :80 | awk &#39;{print $5}&#39;</code> | <code>grep -Eo &#39;([0-9]{1,3}\.){3}[0-9]{1,3}&#39; | sort | uniq -c | sort -n</code>  conn port 80
<strong>perl</strong>   <code>perl -pi -e &#39;s,RoseHosting,BestManagedVPS&#39; file.php</code> Replace all string instances w/o opening file w text editor
<strong>pscp</strong> <code>pscp -agent -i &lt;keyfile&gt; -P &lt;port&gt;</code> (-agent is for pageant)
<strong>sed</strong>   <code>sed -e &#34;s/\r//g&#34; file &gt; newfile</code> remove newline chars from file | <code>sed -i &#39;s/search/repace/g&#39; *.php</code>  replace string in all specified files |
<strong>systemctl</strong>   <code>sudo systemctl restart apache2</code> | <code>sudo systemctl -a</code> | <code>sudo systemctl --state active</code> | <code>sudo systemctl list-timers</code> | <code>sudo systemctl list-unit-files</code> | <code>sudo systemctl list-unit-files | grep -i docker</code> |
<code>sudo systemctl | grep running</code> (list <em>running</em> services) | <code>sudo systemctl list-unit-files | grep enabled</code>  (list <em>enabled</em> services) |
<code>sudo systemctl reload ssh.service</code> | <code>systemctl list-unit-files --type=service</code> | <code>systemctl list-dependencies graphical.target</code> | <a href="https://opensource.com/article/20/5/systemd-units" rel="nofollow">article</a> | <code>sudo systemctl enable apache2</code> | <code>sudo systemctl disable apache2</code> | <code>sudo systemctl is-enabled apache2</code> | <a href="https://linoxide.com/linux-how-to/enable-disable-services-ubuntu-systemd-upstart/" rel="nofollow">article</a> |
<strong>tar</strong>   <code>tar -cvzf archive-name.tar.gz directory-name</code> |  <code>tar -C /diff-folder -xvf yourfile.tar</code> to extract to a different directory |
<strong>timedatectl</strong>   <code>timedatectl</code> | Bash date to/from unix epoch time: <code>date +%s</code> | <code>date -d @&lt;unix epoch time&gt;</code> |
<strong>vim</strong> <code>:w !sudo tee %</code> |  <code>:set ignorecase</code> |  <code>:set ff=unix</code> or <code>:set ff=dos</code> | <code>:set number</code> or <code>:set nonumber</code> | <code>:nohl</code> |</p>

<p><code>df -h</code> | <code>df -T</code>
<code>du -sh</code>
<code>dpkg-query -L &lt;package name&gt;</code>   (list files in package)
<code>faillog</code> | <code>free</code> |
<code>history -c</code>
<code>host ipaddr|domain</code>  (Cloud Shell: get ip addr for domain or domain for ip addr, etc)
<code>hostnamectl status</code>
<code>id &lt;username&gt;</code>
<code>sudo iptables -L -nv --line-numbers</code> | <code>sudo iptables-restore &lt; /etc/iptables/rules.v4</code> |
<code>lastlog</code> | <code>last</code>
<code>sudo lshw</code>
<code>sudo sshd -T</code> | /etc/ssh/sshd_config | <a href="https://linux-audit.com/audit-and-harden-your-ssh-configuration/" rel="nofollow">ssh security hardening</a> |
lsb_release -a <code>| cat /proc/version</code>
<code>wget --no-check-certificate</code>
<code>whatis</code>
<code>zgrep -E &#34;^(Remove:|Purge)&#34; /var/log/apt/history.log*</code>
<code>sudo -u www-data php occ app:list</code>
<code>zip -d gallery.zip &#34;picture_43_9.jpg&#34;</code>  (delete file from zip, note zip goes first, followed by file)</p>

<p><code>gcloud info</code> | <code>gcloud version</code> |
Windows: <code>netstat | findstr ESTABLISHED</code></p>

<p><a href="https://victoria.dev/blog/how-to-replace-a-string-in-a-dozen-old-blog-posts-with-one-sed-terminal-command/" rel="nofollow">Replace string recursively with find and sed</a>
<a href="https://askubuntu.com/questions/365965/how-to-remove-all-rc-residual-packages-using-command-line-at-once" rel="nofollow">Remove all dpkg rc residual packages</a></p>

<p>delete every line until PATTERN, that line included: <code>cat index.html | sed &#39;1,/body onload/d&#39;</code>
print (p) from the first line matching PATTERN to the end ($): <code>cat index.html | sed -n &#39;/body onload/,$p&#39;</code></p>

<p>Which Linux distro is running: <code>cat /etc/*-release</code></p>

<p><a href="https://dev.to/awwsmm/101-bash-commands-and-tips-for-beginners-to-experts-30je" rel="nofollow">101 Bash Commands</a> | <a href="https://blog.balthazar-rouberol.com/text-processing-in-the-shell" rel="nofollow">Text Processing in the Shell</a> |
<a href="https://towardsdatascience.com/mastering-file-and-text-manipulation-with-awk-utility-65fc09d56bef" rel="nofollow">Mastering File And Text Manipulation With Awk Utility</a></p>

<pre><code>dpkg queries:

-l, --list package-name-pattern...
    List packages matching given pattern.
-s, --status package-name...
    Report status of specified package.
-L, --listfiles package-name...
    List files installed to your system from package-name.
-S, --search filename-search-pattern...
    Search for a filename from installed packages.
-p, --print-avail package-name...
    On debian/ubuntu, use instead: apt-cache show package-name
    Display details about package-name, as found in /var/lib/dpkg/available. 
</code></pre>

<p><a href="https://www.labnol.org/network-commands-200706" rel="nofollow">Useful network commands, labnol</a>
<a href="https://dev.to/tracycss/basic-regex-in-javascript-for-beginners-1dnn" rel="nofollow">Basic regex in javascript</a></p>

<p>/etc/alternatives (e.g., php cli version, check vs apache version)</p>

<p>what process(es) are running for port 443: <code>sudo lsof -t -i:443</code></p>

<p><strong><code>journalctl</code> — query the systemd journal.</strong>
<a href="https://systemd.io/" rel="nofollow">Systemd</a> has its own logging system called the <strong>journal</strong>.  To read those logs, <a href="https://www.freedesktop.org/software/systemd/man/journalctl.html" rel="nofollow">journalctl</a> is used.
The journal (<a href="https://docs.datadoghq.com/integrations/journald/" rel="nofollow">journald</a>) stores log data in binary format, unlike past services that stored logs in plain text. As such, <code>journalctl</code> is used to transmute binary logs into readable plain text. Check out <a href="https://www.loggly.com/ultimate-guide/using-journalctl/" rel="nofollow">The ultimate guide to using journalctl</a>.
Another good read is <a href="https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg" rel="nofollow">kmsg</a>. Kmsg (/dev/kmsg) is a file stored in the Linux filesystem, used to store messages from the Kernel, and is used by dmesg and klogd.</p>

<p><a href="https://haydenjames.io/linux-commands-frequently-used-by-linux-sysadmins-part-5/" rel="nofollow">Linux Commands frequently used by Linux Sysadmins – Part 5</a></p>

<p><a href="https://dev.to/shaikh/how-to-manage-background-processes-in-linux-1d2m" rel="nofollow">How to manage background processes in Linux</a></p>

<p><a href="https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf" rel="nofollow">cheatsheet for ip commands <a href="/scitech/tag:network" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">network</span></a> <a href="/scitech/tag:linux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">linux</span></a></a></p>
]]></content:encoded>
      <guid>https://qua.name/scitech/new-commands</guid>
      <pubDate>Thu, 12 Nov 2020 23:10:54 +0100</pubDate>
    </item>
  </channel>
</rss>