Anna

How to echo Shell Commands

How to echo Shell Commands?

Linux bash scripting uses the “set -x” and “set -v” commands to echo the defined set of shell commands placed in it at any point.

How to Stop Docker in Linux

How to Stop Docker in Linux?

To stop the Docker under Linux, utilize the “systemctl” and “service” command line manager with the “stop” utility. Follow the detailed procedure here

Restart PostgreSQL in Ubuntu

How to Restart PostgreSQL in Ubuntu?

To restart the “PostgreSQL” server in Ubuntu, use the “systemctl” and “service” command line managers with the “sudo” support in case of non-root users.

What is $$ in Bash Shell Script

What is $$ in Bash Shell Script?

In Linux, the bash shell variable “$$” returns the current bash shell process id that can be checked through the “echo” and the “ps(process)” commands.

How to Use split() with awk in Linux

How to Use split() with awk in Linux?

The “split()” is the “awk” command line function that splits the defined string into an “awk” array separated by the delimiter(default/user-choice).

What is $PWD in Linux

What is $PWD in Linux?

The “$PWD” is an environment variable that contains the absolute path of the current working directory starting from the “root(\)” directory.

How to Argument String to Integer in Bash

How to Argument String to Integer in Bash?

To convert the argument string to an integer using the “$((…))” arithmetic expansion operator, “expr,” “let,” “bc,” and “awk” commands in the bash script.

Bash Multiplication and Addition

Bash Multiplication and Addition

In Linux, the bash addition and multiplication operations can be performed using the “arithmetic expansion,” “expr,” and the “let” command line utility.

How To Set Date and Time On Linux

How to Set Date and Time On Linux?

To set the manual date and time of the system, use the “date”, “timedatectl”, “hwclock”, and “ntpdate” commands and the “Date &Time” option via GUI.

Where are my sshd Logs in Linux

Where to Find sshd Logs in Linux?

The sshd Logs are stored in the “/var/log/auth.log” file. These log details can be displayed using the “grep”, “lastlog”, and the “journalctl” commands.

How to Color diff Output

How to Color diff Output?

To color diff output use the “diff –color” command for the newer version of “diff” and the “colordiff” command line tool for the older versions.

How to Add New Lines When Using echo

How to Add New Lines When Using echo?

To add new lines, use the “-e(backspace interpreter)” and “$(bash variable)” with the “echo” command. An “echo” tool can also be used multiple times to do this.

How to Install the Latest cURL on Linux

How to Install the Latest cURL on Linux?

In Linux and its distributions, the “curl” can be installed via default package managers i.e “apt” (Ubuntu/Debian), “yum” (CentOS/RHEL), and “dnf” (Fedora).

How To Generate A Strong Password In Linux

How to Generate a Strong Password in Linux?

To generate a strong password, use the “urandom”, “makepasswd”, “gpg”, “apg”, “pwgen”, and “openssl rand” commands. It can also be done using the “Perl” script.

How to Loop Over the Lines of a File

How to Loop Over the Lines of a File?

Use the “for” and “while” loops in the shell script to read the file content line by line. Both these loops provide simple syntax to perform this task easily.

How Do I Create a Permanent Bash Alias

How to Create a Permanent Bash Alias?

To create a permanent bash alias, edit the “~/.bashrc” file in Linux. After that, reload it using the “source ~/.bashrc” command to activate newly alias.

What is _declare_ in Bash

What is “declare” in Bash?

In Bash, the “declare” command sets the variable and functions alongside their attributes, “integer”, “string”, “array”, and “read-only” variables.

How to Restart the SSH Service

How to Restart the SSH Service?

Linux offers the “systemctl” and “service” commands to restart the “SSH” service instantly. It can also be restarted by accessing the “/etc/init.d” directory.