×

This article covers how to show an asterisk as visual feedback while typing sudo password. Try once on Ubuntu or Centos by doing small changes on the file on /etc/sudoers file. 

To Show Asterisks While Typing Sudo Password in Linux, simply edit the /etc/sudoers file and add pwfeedback. This makes the asterisks visible when the password is entered. After the file is edited and saved, we type reset command for the effect to take place.



This article covers how to set and unset both local and persistent environment variables in Linux. In fact, every time you start a shell session in Linux, the system goes through configuration files and sets up the environment accordingly. Environment variables play a significant role in this process.

Environment variables are a set of key value pairs stored on your Linux and used by processes in order to be able to perform specific operations. with the export command but also by modifying some system files to make them persistent.


How to Set Environment Variables on Linux using export ?

The easiest way to set environment variables is to use the export command:

$ export VAR="value"


How to Unset Environment Variables on Linux Using unset command ?

To unset an environment variable, use the unset command with the following syntax:

$ unset <variable>


Common Set of Environment Variables on Linux:

  • USER : the current username of the user using the system;
  • EDITOR : the program run to perform file edits on your host;
  • HOME : the home directory of the current user;
  • PATH : a colon separated list of directories where the system looks for commands;
  • PS1 : the primary prompt string (to define the display of the shell prompt);
  • PWD : the current working directory;
  • _ : the most recent command executed on the system (by the user)
  • MAIL : the path to the current user’s mailbox;
  • SHELL : the shell used in order to interpret commands on the system, it can be many different ones (like bash, sh, zsh or others);
  • LANG : the language encoding used on the system;
  • DESKTOP_SESSION : the current desktop used on your host (GNOME, KDE)
  • HISTFILESIZE : number of lines of command history stored in the history file;
  • HISTSIZE : number of lines of history allowed in memory;
  • UID : the current UID for the user.



This article covers the most popular shells among Linux users. In fact, Shell is an environment in which we can run our commands, programs, and shell scripts. There are different flavors of a shell, just as there are different flavors of operating systems. Each flavor of shell has its own set of recognized commands and functions. As Linux is flexible we can switch between shells easily without any additional configuration.


What is a Shell Prompt in Linux ?

The prompt, $, which is called the command prompt, is issued by the shell. While the prompt is displayed, you can type a command.

Shell reads your input after you press Enter. It determines the command you want executed by looking at the first word of your input. A word is an unbroken set of characters. Spaces and tabs separate words.

Following is a simple example of the date command, which displays the current date and time:

$date
Thu Jun 25 08:30:19 MST 2021


Functions of Linux kernel:

  • Controls all computer operations.
  • Coordinates all executing utilities.
  • Ensures that executing utilities do not interfere with each other or consume all system resources.
  • Schedules and manages all system processes.



This article covers how to use bash shebang in Linux. In fact, the first line in the scripts starts with the #! characters and the path to the Bash interpreter is called shebang and is used to tell the operating system which interpreter to use to parse the rest of the file.

The #! syntax used in scripts to indicate an interpreter for execution under UNIX / Linux operating systems. Most Linux shell and perl / python script starts with the following line:

#!/bin/bash

OR

#!/usr/bin/perl

OR

#!/usr/bin/python

OR

#!/usr/bin/python3

OR

#!/usr/bin/env bash

sh is the standard command interpreter for the system. The current version of sh is in the process of being changed to conform with the POSIX 1003.2 and 1003.2a specifications for the shell.



This article covers how to redirect stderr to stdout in Bash. When redirecting the output of a command to a file or piping it to another command, you might notice that the error messages are printed on the screen. In Bash and other Linux shells, when a program is executed, it uses three standard I/O streams. Here, A file descriptor is just a number representing an open file. The input stream provides information to the program, generally by typing in the keyboard. The program output goes to the standard input stream and the error messages goes to the standard error stream. By default, both input and error streams are printed on the screen.



This article covers the different methods to check the Ubuntu Version by the terminal. While working with the system, we need to install multiple third-party software, which is available for version-specific. In that case, you need to find the Ubuntu version you are using.

The lsb-release is the standard package for reporting the version on Ubuntu systems. Which is basically written in the Python programming language. It provides lsb_release command-line tool to check Ubuntu version and other useful details.



This article covers steps to install and configure Git on a Debian 10 server. As one of the most popular version control systems currently available, Git is a common choice among open-source and other collaborative software projects. Many project's files are maintained in a Git repository, and sites like GitHub, GitLab, and Bitbucket help to facilitate software development project sharing and collaboration.


How to install Git on Debian / Ubuntu Linux System ?

1. Use the apt package management tools to update your local package index and then download and install Git:

$ sudo apt update
$ sudo apt install git

2. You can confirm that you have installed Git correctly by running the following command:

$ git --version



This article covers how to use the source command in Linux. source reads and executes commands from file filename in the current shell. If filename does not contain a slash, directories in PATH are searched for filename.

Using source to execute the commands in a file is not the same as running a script. For one thing, the file does not need to be executable (e.g., with chmod u+x). For another, the commands will execute in the current shell environment; for example, any variables set will retain their value after the source is finished executing.


Source Command Syntax

The source command uses the following syntax:

$ source [filename] [arguments]

Where:

  • [filename]: The name or path to the file you want the source command to execute.
  • [arguments]: Any arguments you provide become positional parameters when the file is executed.



This article covers how to view / preserve or delete terminal history on Ubuntu Linux System. Terminal history can be a benefit in case you want to revisit/recall the past commands. But it can be a security risk because they can show system tools, configurations, and settings. 

The history mechanism in Ubuntu keeps track of terminal commands you executed.

To view your command line history, Open the Ubuntu terminal and Type :

$ history

This will display the list of previous bash commands you executed in the terminal.


To delete your Ubuntu terminal history, Type:

$ history -c

This will clear your Ubuntu terminal history. Also, you need to know that command line history is user independent, means every user has their own separate history. When you execute history -c command, it will only clear terminal history of the current user.



This article covers the different ways you can easily find out the interface link speed of any specific interface in Linux Mint 20. IP command is similar to ifconfig, which is used for assigning Static IP Address, Route & Default Gateway, and so on.

Also the ethtool command is used to query or control network driver and hardware settings:

# ethtool eth0



This article covers different loop formats available in Bash Scripting. Bash For loop is a statement that lets you iterate specific set of statements over series of words in a string, elements in a sequence, or elements in an array.


The syntax of the for loop is:

for VARIABLE in PARAM1 PARAM2 PARAM3
do
  // scope of for loop
done



This article covers how to install the "bashtop" utility on your Linux Mint 20 system. Bashtop is a command-line based resource monitor written in bash, which depicts usage and statistics for the CPU processor(s), RAM, hard disks, network sources, and other running processes. It also contains a customizable menu and a fully responsive terminal user interface. 

Now, you will be able to use this utility for monitoring the resource usage statistics on your system. 


To Run or start Bashtop application, run one of the following commands.

# bashtop
# bpytop



This article covers an overview of conditional statements in bash scripts. Bash expression is the combination of operators, features, or values used to form a bash conditional statement. Conditional expression could be binary or unary expression which involves numeric, string or any commands whose return status is zero when success.

Bash if conditionals can have different forms. The most basic if statement takes the following form:

if TEST-COMMAND
then
  STATEMENTS
fi



This article covers different methods to add or delete the user in your Linux Mint system. For adding new users in system there are two commands available in your system, useradd and adduser. adduser command is the enhanced version of the useradd command. adduser command uses useradd command in the backend.



This article covers how to run your own shell script as a systemd service. Basically, Systemd is a software application that provides an array of system components for Linux operating systems. It is the first service to initialize the boot sequence. This always runs with pid 1. This also helps use to manage system and application service on our Linux operating system.


How to Enable New Service in Linux?

1. To reload the systemctl daemon to read new file, execute:

$ sudo systemctl daemon-reload 

2. To enable the service to start on system boot, also start the service using the following commands:

$ sudo systemctl enable shellscript.service 
$ sudo systemctl start shellscript.service 

3. To verify the script is up and running as a systemd service:

$ sudo systemctl status shellscript.service



This article covers Both wget and curl which are the free and open-source command-line utilities used for the non-interactive downloading of files. Remember, although both the utilities can download files from the web; they do differ a lot in terms of functionalities.

url can be used to transfer data over a number of protocols. It supports many protocols including HTTP, HTTPS, FTP, TFTP, TELNET, SCP, etc. using Curl, you can download any remote files. It supports pause and resumes functions as well.

To Install curl,

Launch command line application in Ubuntu that is Terminal by pressing the Ctrl+Alt+T key combinations. Then enter the below command to install curl with sudo:

$ sudo apt install curl



This article covers the best method to send processes to the background in your Linux system. This is helpful, if you have started a command on terminal and that command is taking to much time. Now you want to move that in background, so that you can continue with other tasks.


To list all jobs running in background use jobs command. It will show all running commands with their job id:

$ jobs


How to Place a Running Foreground Process into the Background in Linux ?

A foreground process is the a process. In order to place a foreground process into the background, we must first put the process to sleep, and then place it in the background.

Execute the command to run your process.

Press CTRL+Z to put the process into sleep.

Run the bg command to wake the process and run it in the background.



This article covers how to check OS version using different methods. You can get more information of Ubuntu releases at official site of the Ubuntu Releases.

If you are using Ubuntu 16.04 then you can Upgrade using this guide Upgrade Ubuntu 16.04 to Ubuntu 18.04 LTS.

Ubuntu is a free, open-source Linux-based operating system, which has a long list of release versions. Finding out which Ubuntu version is running on your system can be important when troubleshooting issues or searching for installation guides.


To check the Ubuntu version, use the following command in terminal:

$ lsb_release -a

This will display you some details about your distribution including Ubuntu version:

Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal



This article covers how to install and Enable SSH service on Ubuntu 18.04 system. You can now login remotely to your server using any SSH client from Linux or Windows system. To increase security of SSH connection by Changing default SSH port to custom one on you system. Get more details about SSH server from official SSH site.

When establishing a remote connection between a client and a server, a primary concern is ensuring security. For Linux users, the best practice of accessing and managing your server remotely is through the cryptographic protocol known as Secure Shell (SSH).


How to Enable SSH on Ubuntu ?

1. To install SSH, first update the package repository cache with:

$ sudo apt-get update

2. Now install the OpenSSH software package by entering:

$ sudo apt-get install openssh-server

If prompted, type in your password and press y (yes) to permit the installation.

3. To verify the installation was successful and SSH is running use the command:

$ sudo service ssh status

The confirmation message that you are looking for is: Active: active (running).



This article covers how to clear the cache and buffer memory of the physical memory along with clearing the swap space when needed.

Every Linux System has three options to clear cache without interrupting any processes or services.


If you want to clear Swap space, you may like to run the below command.

$ swapoff -a && swapon -a


To Clear PageCache, dentries and inodes:

$ sync; echo 3 > /proc/sys/vm/drop_caches


To Clear PageCache only:

$ sync; echo 1 > /proc/sys/vm/drop_caches


To Clear dentries and inodes:

$ sync; echo 2 > /proc/sys/vm/drop_caches



This article covers the procedure of creating and using bash aliases. Running long and complex commands is usually tedious and time-consuming. Aliases provide much-needed relief by providing shortcuts to those complex commands.

These shortcuts can easily be called on the terminal and yield the same result as the complex command. 

This tutorial shows how to create and add aliases permanently to your bash shell on Linux and Unix-like systems.


To Create Bash Aliases

Creating aliases in bash is very straight forward. 

The syntax is as follows:

alias alias_name="command_to_run"

An alias declaration starts with the alias keyword followed by the alias name, an equal sign and the command you want to run when you type the alias. 



This article covers how to create and run a simple shell script in CentOS 8 system. With this, you can easily create and run even complex scripts and automate repetitive tasks. 

If you are using other Linux distributions, you can visit our posts on how to create and run a shell script in Ubuntu , Debian , and Linux Mint .


An SH file is a script programmed for bash, a type of Unix shell (Bourne-Again SHell). It contains instructions written in the Bash language and can be executed by typing text commands within the shell's command-line interface.


To write and execute a script:

1. Open the terminal. Go to the directory where you want to create your script.

2. Create a file with . sh extension.

3. Write the script in the file using an editor.

4. Make the script executable with command chmod +x <fileName>.

5. Run the script using ./<fileName>.



This article covers the method of creating and running a shell script in Linux Mint 20.

With this, you can write and execute complex shell scripts in Linux Mint 20 very easily.


To write and execute a script:

1. Open the terminal. Go to the directory where you want to create your script.

2. Create a file with . sh extension.

3. Write the script in the file using an editor.

4. Make the script executable with command chmod +x <fileName>.

5. Run the script using ./<fileName>.


To save a .sh file in Ubuntu:

1. Run nano hello.sh.

2. nano should open up and present an empty file for you to work in.

3. Then press Ctrl-X on your keyboard to Exit nano.

4. nano will ask you if you want to save the modified file.

5. nano will then confirm if you want to save to the file named hello.sh.


To Make a Bash Script Executable in Linux:

1) Create a new text file with a . sh extension.

2) Add #!/bin/bash to the top of it. This is necessary for the “make it executable” part.

3) Add lines that you'd normally type at the command line.

4) At the command line, run chmod u+x YourScriptFileName.sh.

5) Run it whenever you need!



This article covers how to easily create a shell script and automate repetitive jobs in #Linux. Shell scripts are just a series of commands that you add in a file and run them together.  


To write and execute a #script:

1. Open the #terminal. Go to the directory where you want to create your script.

2. Create a file with . sh extension.

3. Write the script in the file using an editor.

4. Make the script executable with command chmod +x <fileName>.

5. Run the script using ./<fileName>.


#Shell is a #UNIX term for an interface between a user and an operating system service. 

Shell provides users with an interface and accepts human-readable commands into the system and executes those commands which can run automatically and give the program's output in a shell script.



This article covers different methods to quickly find the IP address of your #Linux Mint system. 

The simplest way to check the ip address of linux Mint, when using the bash shell is typing the command ifconfig. 

On typing the ifconfig you will not only be provided with the ip address, but also the mac address, subnet mask and other information. 


The following commands will get you the private IP address of your interfaces:

1. ifconfig -a.

2. ip addr (ip a).

3. hostname -I | awk '{print $1}'.

4. ip route get 1.2.

5. nmcli -p device show.


What is the #ipconfig command for Linux?

ifconfig(interface configuration) command is used to configure the kernel-resident network interfaces. It is used at the boot time to set up the interfaces as necessary. 

After that, it is usually used when needed during debugging or when you need system tuning.



This article will guide you on how to check your private IP address in #Ubuntu 20.04 LTS system. 

ifconfig command is used to display or configure a network interface.

To use command prompt (CMD) to find my #IP #address:

1. Open the command prompt: if you have a Start menu in your Windows system, open it and type cmd into the search bar.

2. Type ipconfig into the command prompt (or the Run box).

3. Find your IP address within the text that pops up.

You can also use the following commands will get you the private IP address of your interfaces:

i. ifconfig -a.

ii. ip addr (ip a)

iii. hostname -I | awk '{print $1}'

iv. nmcli -p device show.



This article will guide you on how to shut down your Debian 10 system properly using different methods.

If you run a desktop environment, there is usually an option to "log out" available from the #application menu that allows you to shutdown (or #reboot) the system. 

Alternatively you can press the key combination Ctrl+Alt+Del.

To shut down #Linux:

1. To shut down the system from a terminal session, sign in or "su" to the "root" account. 

2. Then type ``/sbin/shutdown -r now''. It may take several moments for all processes to be terminated, and then Linux will shut down.



This article will guide you on different methods of creating and running a #shell #script in #Ubuntu 20.04. Shell Scripting is an open-source #computer program designed to be run by the #Unix / #Linux shell. Shell Scripting is a program to write a series of commands for the shell to execute. To write and execute a script: 1. Open the #terminal. Go to the directory where you want to create your script. 2. Create a file with . sh extension. 3. Write the script in the file using an editor. 4. Make the script executable with command chmod +x . 5. Run the script using ./.



This article will guide you on how to check your Ubuntu version so that you can apply patches and update versions for security and performance reasons. The Process of Checking the #Ubuntu version in the #terminal ? i. Open the terminal using "Show Applications" or use the keyboard shortcut [Ctrl] + [Alt] + [T]. ii. Type the #command "lsb_release -a" into the command line and press enter. iii. The terminal shows the Ubuntu version you're running under "Description" and "Release".



This tutorial will guide you on how to write a simple shell script and run a script in Linux operating system with help of chmod and other commands.



This article will guide you on how to set up an OpenVPN server on Debian Linux 10 server.




More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com