Exit 2 – Finished Background Job Status
An exit code of “2” means the program or command could not execute successfully. It usually occurs when the command syntax needs to be corrected.
An exit code of “2” means the program or command could not execute successfully. It usually occurs when the command syntax needs to be corrected.
The word “esac” is written at the end of the bash case statement that, tells the script to terminate the case statement. Read this article for more details.
In the dead state, the process has terminated but has not yet been cleaned up by the system. The system resources will still be in use in this state.
The “z” is the operator in the Bash script considered for checking whether the variable is empty or not utilized in the “if” conditions.
In the bash script, the OR (||) is the logical operator examined for checking the conditions. It returns the results as “true” or “false.”
In the bash script, the data is written into the text file using the redirection operator (>, >>), tee command, or while loop.
There is no official support for GoToMeeting on Linux but can be used through the online web application on the Chrome browser only.
The ServerAliveInterval and ClientAliveInterval specify the time before the connection is closed after no response from either client or server.
The grep command used with the flag -e makes running on multiple AND patterns possible. The -e flag can be combined with other flags like -c, -n, and -w.
To umount non-sudo sshfs created directory, the umount and fusermount commands are used. However, the umount command can have permission issues.
To install CUDA on Ubuntu, execute the “sudo apt install nvidia-cuda-toolkit” command. Before it, check the status of the GPU that supports the CUDA or not.
In the Bash script, to check the number of passed arguments, use the special variable “$#” that holds the total number of passed arguments.
The string variables are compared in an“if” statement to check the equality/inequality of the strings using the “==” or “!=” operator.
In the bash script, to check whether the directory exists, utilize the “d” operator or “L” operator if the directory is symbolically linked.
In Linux, the timestamp is generated through the date command, bash script, and the python module in various formats like “Year-Month-Day Hour-Minutes-Seconds”.
The “bin” directory contains the executable binary files of various types which depend upon the location where the “bin” directory exists.
The nohup runs the task in the background without interruption, the disown deletes the background tasks while the ampersand(&) runs the task in the background.
The user can emulate the do-while loop in the bash script using the while loop syntax with “do”
that executes when the condition is true.
There is currently no equivalent of Thread Directory on Linux, but it is proposed. Linux supports Task Scheduler and Intel’s Resource Director Technology.
To fix the error “bad substitution” in the bash script, use the correct syntax, avoid repetition of characters and remove extra white spaces from the script.
The main reason for the error “mkvirtualenv: command not found” is that the virtual environment is not set. See the guide for more reasons and the solution.
To fix the error “integer expression expected,” use the correct bash syntax for integer and non-integer values. Read this post for more details on the error.
The reason for the error “pg_config executable not found” is the missing library. The “libpq-dev” is not installed which can be resolved by installing “libpq-dev”
The cron script does not execute as expected is fixed by starting cron daemon, providing valid path to the script, giving execute permissions and fixing script.
To fix the error “jupyter: command not found”, open the “.bashrc” file and export the “~/.local/bin” path in it then apply the source command to execute it.
A substring is part of a string contained within another string. It can be used for searching, manipulating, and extracting specific parts.
All the messages in Linux (kernel and system) are passed through the rsyslog.conf file. The file has Global Directives, Modules, Rules, Selectors, and Actions.
The wildcard asterisk (*) is used to list all the files for the scp command. Using the asterisk, users can copy multiple files and the whole directory.
Linux shell command “tar” supports the “–exclude” argument to exclude certain files/directories by placing them one after the other.
Linux offers the “Smartctl”, and “nvme-cli” command line tools and “Disks” application in GUI to test the health of SSD/HDD.
To force ssh clients to use only password authentication, users must change PublicKeyAuthentication yes to “no,” and add PasswordAuthentication yes.
To fix the client/server “connection refused” error, open the port on the server side and make communication with the client using a specific port.
To create a link to a directory, use the “ln(link)” command followed by the “-s” flag at the current working directory or the user-choice location.
A M3U8 consists of the URLs of the playlists, and it can be viewed online or downloaded using the FFmpeg tool. The file is then played using the VLC player.
JSON scripting is not supported in shell scripting, but with the help of the jq command, it is made possible to the best extent. The curl command also helps.
In a Bash script, the “set -e” identifies the error location and exits the script execution quickly without the execution of other commands.
To extract file basename without path and extension, use the “basename” command. It can be done using the “parameter expansion” without the “basename.”
The string variables can be easily concatenated by “placing them sequentially” and using the “+=” operator in Bash shell scripts.
To change the dictionary in the current bash shell execute the script(bash) having the cd command with the “dot(.)” symbol and the “source” command.
Bash provides the “-v”, “-z”, and “-n” options to check whether the variable is set or not, at the conditional statement of the “if-then-else-fi” loop.
To compare two files in a Linux terminal, use the “diff(difference)” command, its supported “–color” flag for colorized output, and the “vimdiff” command.
The “-f(follow)” parameter of the “tail” command is mainly used by the system administrator for monitoring the text and log files in real-time.
The CIFS share is mounted when the mount command is used with the cifs-utility. To automatically mount, credentials are added in the/etc/fstab file.
In Linux, the “grep” command allows the “-l(files-with-matches)” flag and the combination of the “find” command to show just filenames.
The “Ctrl-Z” key and the “&(ampersand)” symbol are different on the basis of their “objectives”, “usage”, “implementation” and “states”.
In Linux, the “nc -l” command creates a simple network server by specifying the
In Linux, the “ALL ALL=(ALL) ALL” grants full sudo privileges to all users on all hosts for all commands in the sudoers file.
The & wait $! notation allows scripts to run commands in parallel, wait for commands to complete, or perform actions based on the success or failure of commands.
In Bash, the “<<<” operator means “here strings.” It allows users to pass a string as the standard input to a command via the “command <<< string” syntax.
To restart the Bash shell without restarting the terminal application, type the “exec bash” command that replaces the current process with the Bash shell.
To start/stop or enable/disable the firewalld services, execute the “sudo systemctl
Users can monitor log files in real-time and keep tailing them even when the latest date of one changes by following the “tail [options] [log_file]” syntax.
To match the exact string using the “grep” command, use the “grep -w “matching_string”
To clean the yum cache for untracked repositories, disable the untracked repositories and clean the Yum cache via the “yum clean all” command.
To enable/disable SELinux modes in CentOS, assign the “enforcing” or “disabled” value to the SELINUX parameter in the SELinux configuration file.
To test the PHP script in Linux, create a .php script file and run the “php script_name.php” command. Also, users can access the script file in the web browser.
The “cmake: command not found” error is fixed by installing the “Cmake” package or adding the Cmake binary to your PATH environment variable.
The “Nslookup: command not found” error occurs when the nslookup command is not installed. To install it, run the “yum install bind-utils” command.
The “json.dumps()” method of the JSON module and “pprint.pprint() function“ of the pprint module is used to print JSON string and JSON file pretty.
A Python destructor is a special method called automatically when an object is about to be destroyed or deleted using the del keyword.
A Python program returns Exit Code 0 if it has successfully executed and completed without errors. This enabled the program to run smoothly.
The “yaml.load()”, “yaml.dump()”, and “yaml.full_load()” of the “PyYAML” module is used to read, write and parse YAML files in Python.
The “BeautifulSoup” module, “PyQuery” module, and “lxml” module supported various functions that are used to parse HTML in Python.
The “pandas.pivot_table()” function is used to create a pivot table in Python. Pivot tables are also created based on index values and column values.
To read, print and set environment variables, the “os.environ.get()” method, os.environ dictionary, for loop is used in Python.
10 commands that can be destructive to Linux OS are explained in this blog, and users should avoid running these commands.
SCP is a file transfer protocol, but sometimes the transfer speed gets very slow. Different methods that affect the speed have been discussed.
The set command is used to configure the behavior of the shell, and the -e and -o pipefail options are used to control the execution of subsequent commands.
To find out which files differ by content in the given two directory trees, the diff command is used, and if you want a GUI-based tool, use the meld tool.
In Bash, the hash table is the associative array which is defined using the declare command along with the “A” flag by specifying the array name.