Knowledgebase

Linux

Linux, cPanel, CentoOs

Articles

How to Change a User Password in Linux (passwd and chpasswd) Ubuntu, Debian, AlmaLinux, Rocky Linux and other Linux servers (the passwd, chpasswd and chage commands) On Linux you change passwords with the passwd command. Any user can change their own password; the root user (or a user with sudo) can change anyone’s. We tested... How to Change or Set System Locales in Linux? A locale is a set of environmental variables that defines the language, country, and character encoding settings (or any other special variant preferences) for your... How to Change the Default Shell in Linux and Ubuntu with chsh or usermod, and Switch to Another User Updated 4 November 2026 Ubuntu 26.04 (passwd 4.17.4, sudo-rs 0.2.13), Debian 13 and AlmaLinux 10.2 (util-linux 2.40.2), tested; AlmaLinux and Ro To change your own default shell in Linux, run chsh -s with the full path of the new shell and enter your password, then log out and back in: chsh -s /usr/bin/zsh To... How to Change the Hostname Permanently in Linux (Fedora, Rocky Linux, RHEL 9 and Ubuntu) and Set the Domain Name Updated 4 November 2026 hostnamectl on Fedora 44 (systemd 259), Rocky Linux 9 (systemd 252, same as RHEL 9) and Ubuntu 24.04 (systemd 255); the To change the hostname permanently in Linux, run sudo hostnamectl set-hostname server1.example.com. It writes the new name to /etc/hostname, so it survives a reboot,... How to Check CPU Frequency in Linux (lscpu, cpupower) Updated 4 November 2026 Debian 13 (util-linux 2.41, cpupower 6.12, turbostat 2024.07.26), tested on a KVM virtual machine; the same commands wor To check the CPU frequency in Linux, run grep MHz /proc/cpuinfo: it prints the current clock of every CPU in MHz. lscpu adds the model name and, on hardware with... How to Check CPU Usage on Linux: top, htop, mpstat and sar Ubuntu 26.04 and 24.04, Debian 13 and AlmaLinux 10; procps-ng 4.0.4 (top, ps, vmstat), sysstat 12.6 to 12.7 (mpstat, sar To check CPU usage on Linux, run top and read the %Cpu(s) line at the top. us plus sy is the share of CPU time spent on work; id is idle. The process list below it is... How to Check Execution Time of a Process in Linux? Updated 28 September 2026 Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 These tools measure how long a command or process runs. They work on Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9. time: measure a command time tar czf... How to Check Open Ports in Linux and Ubuntu (Listening Ports) Updated 4 November 2026 Ubuntu 26.04 (iproute2 6.19, net-tools 2.10, lsof 4.99, nmap 7.98, netcat-openbsd 1.234) and 24.04, Debian 13, AlmaLinux To check open ports on Linux, run sudo ss -tulpn. It lists every TCP and UDP port a program is listening on, with the program’s name. Listening is only half the... How to Check if a Port Is in Use on Linux (Port Status) Updated 4 November 2026 Ubuntu 26.04 (tested: iproute2 6.19, nginx 1.28.3, Apache 2.4.66, Python 3.14, Node.js 22) and AlmaLinux 10 (iproute 6.1 To check if a port is in use on Linux, run ss -ltn 'sport = :8080' (replace 8080 with your port, and use -lun for a UDP port). If only the header line comes back, the... How to Check the Kernel Version in Linux: Running Kernel, Installed Kernels and Reboot Check Ubuntu 26.04 and 24.04, Debian 13, AlmaLinux 9 and 10; tested in Docker with Ubuntu kernel packages 7.0.0-14 and 7.0.0-3 Run uname -r to see which kernel your server is running right now. It works on every Linux distribution and doesn’t need root. The kernel that is running can be... How to Clear BASH Command Line History in Linux? Updated 3 November 2026 bash, tested on current Debian, Ubuntu and AlmaLinux To clear the current shell's bash history, run history -c, then also clear the history file on disk with history -w so a new shell does not load the old entries back... How to Clone a Partition or Hard drive in Linux? With dd command you can copy an entire hard drive or just a Linux partition. Let's start with cloning one of our partitions. In my case, I have the following drives:... How to Compare Files in Linux: diff, cmp, vimdiff and Meld Updated 17 October 2026 GNU diffutils 3.7 to 3.12 (AlmaLinux and Rocky Linux 9 and 10, Debian 13, Ubuntu 24.04 and 26.04), Vim 8.2 to 9.1, Git 2 To compare two files in Linux, run diff file1 file2. It prints only the lines that differ; no output means the files are identical. For output that is easier to read,... How to Compare Two Directories With diff and Meld Updated 28 September 2026 GNU diffutils 3.7 and later and Meld 3.22 on AlmaLinux and Rocky Linux 9 and 10, Ubuntu 24.04 and 26.04, Debian 13, Fedo To see how two folders differ, for example a backup and the live site, or two releases of an application, use diff on the command line or Meld on a desktop. diff is... How to Configure and Manage firewalld on AlmaLinux and Rocky Linux Updated 22 October 2026 AlmaLinux 9 / Rocky Linux 9 CentOS 8 reached end of life in 2021. Its firewall, firewalld, works the same on AlmaLinux 9 / Rocky Linux 9, so this guide uses those. Check the firewall systemctl... How to Connect Wi-Fi from Linux Terminal Using Nmcli Command? There are several command-line tools for managing a wireless network interface in Linux systems. A number of these can be used to simply view the wireless network... How to Convert Images to WebP Format in Linux? WebP is a relatively new, open-source image format that offers exceptional lossless and lossy compression for images on the web, designed by Google. To use it, you... How to Copy Files with Permissions in Linux (cp -p, rsync -a and chmod --reference) Updated 4 November 2026 GNU coreutils 9.4 to 9.7 and uutils coreutils 0.10.0 on Ubuntu 24.04 and 26.04, Debian 13 and AlmaLinux 10; rsync 3.2.7 To copy a file and keep its permissions, owner and timestamps, use cp -p; for a whole folder use cp -a. To give an existing file the same permissions and owner as... How to Copy Folders with scp -r (Recursive Copy over SSH) OpenSSH scp on Linux, macOS and Windows 10 and 11 scp copies files between computers over SSH. To copy a whole folder with its subfolders, add -r (recursive). We tested every example below between a Mac and a Ucartz... How to Create Hard and Symbolic Links in Linux? To Create Hard Links in Linux To create a hard links in Linux, we will use ln utility. For example, the following command creates a hard link named tp to the file... How to Create Multiple User Accounts in Linux The two utilities for adding or creating user accounts in Unix/Linux systems are adduser and useradd. These commands are designed to add a single user account in the... How to Create a Disk Image in Linux with dd: Back Up, Compress, Mount and Restore any Linux system with GNU dd; tested on Debian 13 (coreutils 9.7, util-linux 2.41.5, qemu-img 10.0.13) with image files; To create a disk image in Linux, copy the whole disk into a file with dd: sudo dd if=/dev/sdb of=/backup/sdb.img bs=4M status=progress conv=fsync. The file is an... How to Create a New Ext4 File System (Partition) in Linux? The ext4 or fourth extended filesystem is a widely-used journaling file system for Linux. It was designed as a progressive revision of the ext3 file system and... How to Create a Virtual HardDisk Volume Using a File in Linux Virtual Hard Disk (VHD) is a disk image file format which represents a virtual hard disk drive, capable of storing the complete contents of a physical hard drive. It’s... How to Create and Execute a .Jar File in Linux Terminal? A JAR (Java ARchive) is platform-independent file format used to aggregate many Java class files and associated metadata and resources such as text, images, etc, into...