What is the difference between single and double quotes in Linux Bash

In this article, we will see the difference between single and double quotes in Linux Bash.

single quotes (”) and double quotes (“”)

Single quotes won’t interpolate anything, but double quotes will. For example: variables, backticks, certain \ escapes, etc.

Single Quotes:
Enclosing characters in single quotes (‘) preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.
Continue reading What is the difference between single and double quotes in Linux Bash

Linux Your account has expired; please contact your system administrator

In this article, we will see possible solutions for error “Linux Your account has expired; please contact your system administrator”.

Reasons:

1. Account might be locked
2. User password expired
3. Have not logged in since account created

Verification:
Continue reading Linux Your account has expired; please contact your system administrator

How to find a file exists or not using Linux shell script

In this article, we will see how to find a file exists or not using Linux shell script with examples. We can check the directory exists or not by using if statement with -f option.

Syntax to check if a file exists in a shell script you can use the following:

if [ -f "$FILE" ]; then # Control will enter here if $FILE exists. fi

1. Examples to find a file exists or not using Linux shell script:
Continue reading How to find a file exists or not using Linux shell script

How to find a directory exists or not using Linux shell script

In this article, we will see how to find a directory exists or not using Linux shell script. We can check the directory exists or not by using if statement with -d option.

Syntax to check if a directory exists in a shell script you can use the following:

if [ -d "$DIRECTORY" ]; then # Control will enter here if $DIRECTORY exists. fi

1. Examples to find a directory exists or not using Linux shell script:
Continue reading How to find a directory exists or not using Linux shell script

How to remove all files and folders from current directory in Linux

In this article, we will see how to remove all files and folders from current directory in Linux.

Caution: rm command removes the files and folders permanently it does not move to trash!

1. To remove all files from current directory use the rm -i *.*. This asks us to remove files one after the other. If we type y or yes then it removes and if we press no it will not remove files. In the following examples, we have typed n. So, no files removed.
Continue reading How to remove all files and folders from current directory in Linux