Linux / Unix Command Examples

Here are links to some useful Linux tips:

Awesome. VIM “for people who don’t want to use it , but have to…”. Or see my page

sudo is the right choice for granting admin rights on the CentOS Linux 8 server. Learn how to create a new user and grant her admin rights


  1. Tomi Engdahl says:

    //While Pi-Hole is excellent, there is another option to block ads and malware using DNS. Let us see how to install a DNSCrypt proxy for your whole network to encrypt DNS traffic between clients and resolver on Linux along with an adblocker/malware blocker.

  2. Tomi Engdahl says:

    //Let us see how to find dropped packets stats on Linux and tools that we can use to find out why a Linux server is dropping packets?

  3. Tomi Engdahl says:

    Here is how to get yesterday’s or tomorrow’s (or any other date) in bash on Linux or Unix (FreeBSD/macOS)

  4. Tomi Engdahl says:

    //how to configure OPNsense (FreeBSD based opensource Unix firewall) with DNS Over TLS (DoT) to increase your privacy and security.

  5. Tomi Engdahl says:

    // Learn how to issue Let’s Encrypt wildcard certificate with acme sh and Cloudflare DNS on Linux or Unix system

  6. Tomi Engdahl says:

    //Keep (don’t delete) input files during compression or decompression when using gzip/gunzip on a Linux or Unix like systems:

    ls -l filename
    gzip -k filename
    gunzip –keep input_file_name


  7. Tomi Engdahl says:

    //Enjoy the mysteries of the sea from the safety of your own Linux or Unix terminal!

  8. Tomi Engdahl says:

    //Want to delete LXD based container with lxc command on Linux? Try these simple tips

  9. Tomi Engdahl says:

    Expired TLS/SSL certificates can cause downtime and confusion for end-users. Hence, it is crucial to monitor the expiry date for our TLS/SSL certificates. Let us see how to find out TLS/SSL cert expiry date from the Linux/Unix CLI and write a simple script to alert developers/sysadmin.

  10. Tomi Engdahl says:

    //Let us see how to perform shell script analysis on Linux or Unix. Useful to enhance your shell scripts, avoid errors and productivity

  11. Tomi Engdahl says:

    //Here is how to add network bridge to your Ubuntu Linux desktop or server using the nmcli. Useful for your Docker, LXD, KVM and other VM stuff.

  12. Tomi Engdahl says:

    //Quick tutorial about how to install VirtualBox on Ubuntu 20.04 Linux LTS system

  13. Tomi Engdahl says:

    // {Updated} Learn how to customize and colorize your bash prompt on a Linux, macOS/*BSD or Unix-like systems

  14. Tomi Engdahl says:

    //UFW is an acronym for an uncomplicated firewall. Securing a network with an uncomplicated firewall is super easy and highly recommended. It allows you to protect the server from bad guys, and you can open or close ports, ban IP addresses and limit ssh access and much more quickly. Let us see how to set up and use ufw on Ubuntu 20.04 LTS server.

  15. Tomi Engdahl says:

    Try this: /sbin/ldconfig -NXv
    That should print the state of the ld_library cache without rebuilding it.

  16. Tomi Engdahl says:

    Missing /etc/rc.local support on major Linux distros? Fear not. We can easily enable rc.local shell script support on systemd while booting the Linux system.

  17. Tomi Engdahl says:

    //{Updated} Bash while loop examples for Linux and Unix users

  18. Tomi Engdahl says:

    Linux Jargon Buster: What are GUI, CLI and TUI in Linux?

  19. Tomi Engdahl says:

    Magnificent app which corrects your previous console command.

  20. Tomi Engdahl says:

    //Boss: How do I check which shell I am using?

    More about commands here

  21. Tomi Engdahl says:

    AutoKey: How to Replace Characters with Predefined Text Automatically in Linux

    Welcome to AutoKey, the free desktop automation utility for Linux. Do you often use templates, repeat keystrokes or other repetitive tasks? If so, AutoKey is a great toolkit you do not want to miss out on!

    What is AutoKey?
    Let’s say you often type your email address, or your postal address. It can be a bit frustrating to have to type it out every time. Let AutoKey do it for you! All you have to do is to associate a keyboard shortcut – a set of keystroke events – with a particular blurb of text.

  22. Tomi Engdahl says:

    Can someone advise me on how to lock ssh to specific computer ? E. G so only one computer can access server ubuntu

    for a while i used a preshared key and disabled passwords alltogether

    Two step process.
    Step 1: use pre-shared key so password is not required to ssh from a particular account.
    Step 2: disable ssh password login
    You would need to physically access the local terminal at the server if you get locked out, or install a secure KVM.

  23. Tomi Engdahl says:

    //Want to see max args and other limits for your shell on Linux and Unix environment ( variables? Try:

    false | xargs –show-limits

    getconf -a |grep MAX

  24. Tomi Engdahl says:

    //No need to install a VMware workstation or VirtualBox on Ubuntu for your VM needs. You can use KVM, which is far superior and directly built-into the Linux kernel. Learn how to install KVM on Ubuntu 20.04 LTS headless Linux server

  25. Tomi Engdahl says:

    Interesting thread and shell scripting commends. Running a command in each folder without affecting subfolders

  26. Tomi Engdahl says:

    The Linux System Information Tool inxi

    inxi, the free and open source command line based system information tool, can provide you with a plethora of hardware & software information, in a modular and efficient output format. Ideal for end users, and DevOps, support or QA engineers.

    What Is inxi ?
    The inxi manual defines inxi as a ‘Command line system information script for console and IRC’. Highly efficient (fast), detailed, and modular, inxi provides yo with the details about any area of your computer you would like to inspect or explore.

    This may be of much interest to users who have just bought new hardware (or a completely new system) and would like to explore how the operating system sees the hardware. DevOps engineers may also be interested in using inxi when managing remote servers in the cloud, to explore their capabilities and to see whether the hardware they paid for is actually present.

  27. Tomi Engdahl says:

    How to use the Linux mtr command
    mtr is an essential, real-time network diagnostic tool for your sysadmin toolbox.

    As a Linux sysadmin, you know that the general consensus is to blame every problem on infrastructure, which is your realm. Network engineers, our arch nemeses (kidding), always tell us that, “It’s not a network problem.” I really hate hearing those words because it means that now the focus is on me, my operating systems, and my hardware. Rather than rely on the word of my sworn enemy (kidding again) to tell me where the problem is, I can proactively investigate the network for myself. The mtr utility allows me to do it without bothering anyone else or getting stewed during an all-hands, troubleshooting conference call. The mtr command is a simple but effective network analysis and troubleshooting tool. This brief introduction will get you started.

    The following description is from the mtr command’s package information.

    Mtr is a network diagnostic tool that combines ping and traceroute into one program. Mtr provides two interfaces: an ncurses interface, useful for using Mtr from a telnet* session; and a GTK+ interface for X (provided in the mtr-gtk package).

    *Obviously, this description is somewhat outdated. Replace ‘telnet’ with SSH.

    Why mtr?
    You might wonder why I’m writing about a utility called My Traceroute (mtr) when there is traceroute, ping, netstat, ip, and other tools lying around that can help with troubleshooting network connectivity. Well, mtr is a little different. It is analogous to the top command in that it refreshes on its own and gives you a live look at network response and connectivity.

  28. Tomi Engdahl says:

    //Linux hostnamectl command and options cheat sheet. See for more examples.

  29. Tomi Engdahl says:

    //Where security is critical, we use strong encryption such as Pretty Good Privacy/GNU PGP instead of the relatively weak standard encryption provided by many CLI utilities. Let us see how to encrypt and decrypt files on Linux and Unix command-line.

  30. Tomi Engdahl says:

    Did you know? You can colorized ip command output on Linux and make it easier to read on screen:

    ip -c command
    ip -c route
    ip -c link

    See our guide for more info.

  31. Tomi Engdahl says:

    //An open-source guide to help you write better command-line programs, taking traditional UNIX principles and updating them for the modern day. #Linux #Programming

  32. Tomi Engdahl says:

    //Learn how to boost your Linux server’s Internet speed with TCP BBR configurations. #Linux #Sysadmin #programming

  33. Tomi Engdahl says:

    //How to check TLS/SSL certificate expiration date from your Linux, macOS, *BSD or Unix-like command-line

  34. Tomi Engdahl says:

    //In bash there is an environment variable that allows you to customize your prompt, including colors. I personally like to have different colors for the current user/hostname, info from git, and the current directory. Here is a page with details: #linux #Unix #SysAdmin #programming

  35. Tomi Engdahl says:

    //Explains how to make a superuser (admin) with root-like access to the MySQL or MariaDB databases with secure plugins. Further, learn how to create an encrypted file to store admin user/password, host, and TLS info securely for ease of login via Linux/Unix CLI. #SysAdmin #programming #Linux #Unix #MySQL #DBA

  36. Tomi Engdahl says:

    The free ride is over, guys. CentOS Linux 8, as a rebuild of RHEL 8, will end at the end of 2021. #Linux #Sysadmin #IT

  37. Tomi Engdahl says:

    Beautifully done. Try to explain Linux shell ls command in short. #Linux #Unix #programming #devops


Leave a Comment

Your email address will not be published. Required fields are marked *