Johnson

How to Find Mtime in Linux

How to Find mtime in Linux?

The “stat”, “ls” and “find” commands are used to find the mtime of files in Linux. They display the modification time when the file’s content is modified.

How to Edit Hosts File on Linux

How to Edit Hosts File on Linux?

Linux provides the “nano” and “vim” text editors to edit or modify the host or any other file using the “sudo” privilege. It is easy to access and use.

Bash until Loop Explained

Bash until Loop | Explained

In Bash, the until loop iterates the code until the specified condition is met. Using the until loop, users can modify conditions according to requirements.

How to Clear Command History in Linux

How to Clear Command History in Linux?

Linux offers the “history” utility with the “-c” option and “-w” option to clear the current session’s command history and all previous session history.

How to Create a Ramdisk in Linux

How to Create a Ramdisk in Linux?

Linux offers the “tmpfs” and “/etc/fstab” files to create a ramdisk in the operating system. It is useful for storing and accessing data.

How to Check the CentOS Version

How to Check the CentOS Version?

CentOS offers the “lsb_release”, “hostnamectl”, and “uname” commands to check the CentOS version. Also, the “centos-release” file contains version information.

Sort “du” Command by Size

Sort “du” Command by Size

Sort output from largest to smallest by a combination of “du” and “sort” commands with the “h” option. It displays output in a human-readable format.

Linux more Command With Examples

Linux more Command With Examples

Linux offers a “more” command that allows you to view the contents of a text file or output one page at a time. The syntax with multiple examples is given here.

Scheduling Cron Jobs with Crontab

Scheduling Cron Jobs with Crontab

The cron jobs are scheduled by following the five asterisks pattern. Each asterisk denotes a time (minute, hour, day of the month, month, day of the week).

Linux ls Command File Size Formatting

Linux ls Command File Size Formatting

In Linux, the “ls” command works with “-l” and “-h” options to display the list of file sizes in a long and human-readable format, respectively.

How to check RAM in a Linux

How to Check RAM in a Linux?

In Linux, the “free”, “top”, and “htop” commands are used to check the usage of RAM in the system. The “/proc/meminfo” file also contains RAM information.

fdisk Command in Linux Explained

fdisk Command in Linux | Explained

Linux offers the “fdisk” command to create, delete, and modify the partition in the system. It requires the name of a hard disk to display information.

How to List Containers in Docker

How to List Containers in Docker?

To display the list of containers in docker, run the “sudo docker container ls -a” command. It displays the information of the running container in the system.

How to Take a Screenshot on Linux

How to Take a Screenshot on Linux?

In Linux, the “PrtScr”, “Alt+PrtScr”, and “Shift+PrtScr” keys and third-party tools (Flameshot and Kazam) are used to take a screenshot.

Fix plt.show() not working

Fix: plt.show() not working

In Linux, the “plt.show() not working” can be fixed by executing the “sudo apt install python3-matplotlib” script in the terminal.

How to Play DVD in Ubuntu 22.04

How to Play DVD in Ubuntu?

To enable the playing mode of DVD, your Ubuntu system must be equipped with a media player and the “libdvd-pkg” which contains all the required codecs.

How to List Cron Jobs in Linux

How to List Cron Jobs in Linux?

To list all the cronjobs, use the command “crontab -l”. To list specific cron jobs, use the command “ls -la /etc/cron.hourly/daily/weekly/monthly”.

How to Connect to a Docker Container

How to Connect to a Docker Container?

Docker provides the “docker attach” and “docker exec” commands to establish the connection with the running containers specifying the container name.

How to Check if Crontab is Working?

How to Check if Crontab is Working?

To check crontab services, “status” utility, “ps aux”, “pgrep”, and “tail” commands are used. It provides currently active/dead running processes in the system.

chattr Command in Linux Explained

chattr Command in Linux | Explained

In Linux, the “chattr” command is utilized to change the existing attributes of a file such as “i” for immutable, “a” append mode via “+”, “-” operators.

Understanding the etcpasswd File in Linux

Understanding the /etc/passwd File in Linux

The /etc/passwd file holds the information of “Username”, “Password”, “UID”, “GID”, “GECOS”, “Home directory”, and “Login shell” of the system and normal users.

Fix tar not found in archive

Fix: tar not found in archive

The error “tar not found in archive” is fixed by following the syntax correctly alongside the target directory name and its position in the syntax.

Fix: sudo apt-get command not found

Fix: sudo apt-get command not found

The error “sudo apt-get command not found” can be fixed by downloading the latest APT package manager to install, remove or update packages in the system.

Fix: no module named pkg_resources

Fix: no module named pkg_resources

The error “no module named pkg_resources” can be resolved by installing the python package via “sudo apt install python-pkg-resources”.

unlink Command in Linux Explained

unlink Command in Linux | Explained

In Linux, the “unlink” command removes the file and link after accessing the required directory. It is useful to remove unnecessary files from the system.

How to Save a File Using Nano

How to Save a File Using Nano?

The existing file can be saved by pressing the “Ctrl+S” key in Nano Editor. Also, the “Ctrl+O” key overwrites the file with a different name or file format.

How to Connect Wifi Ubuntu Server

How to Connect Wifi Ubuntu Server?

In Ubuntu, connect the WiFi network through the “nmtui” and “GUI” methods. Both methods require SSID and passwords of a particular internet connection.

How to grant root privileges in Linux

How to grant root privileges in Linux?

In Linux, the “sudo” command is utilized with “- s”, “su -” and “-i” utilities to grant the root privileges from a normal user after authentication.

grep Command in Linux

grep Command in Linux | Explained

In Linux, the grep command is utilized to highlight (shows the match) the specific word, character, or string after searching the entire content in a file.

Fix ssh no route to host

Fix: ssh no route to host

In Linux, the “ssh no route to host” error is fixed through the “ping” command, updating firewall rules for Port 22, and installation of the “OpenSSH” utility.

How to fix SSH host key verification failed error in Linux

Fix: ssh host key verification failed

In Linux, the “ssh host key verification failed” error can be fixed by deleting the host key through Nano Editor or using the “ssh-keygen” command.

Fix sudo unable to resolve host

[Fixed] sudo: unable to resolve host

In the Linux system, the “sudo: unable to resolve host” error can be resolved by configuring the hostname properly (either to change it or use it correctly).

Fix export ld_library_path

Fix: export ld_library_path

The error “export ld_library_path” can be encountered by setting the environment variable to the “/usr/local/lib” directory.

How to Increment a Variable in Bash

How to Increment a Variable in Bash?

In Linux, the “+”, “+=”, “Prefix”, and “Postfix” operators are used to increment a variable in bash. The bash can be executed as “bash ”.

pkill Linux Command Explained

pkill Linux Command | Explained

The “pkill” command kills the execution of currently active processes in linux such as “-f” (full process name), “-o” (oldest process), “-n”(newest process).

What Command Used to Create an Empty File

How to Create an Empty File Linux?

In the terminal, the “touch”, “echo”, “nano”, and “printf” commands are used to create an empty file specifying the file name.

How to Check WSL Version

How to Check WSL Version?

To check the current version of WSL, the “wsl –list –verbose” or “wsl -l -v” command is utilized in the Windows Command Prompt.