UNIX: Set Environment Variable

In UNIX-based operating systems (such as Linux and macOS), you can set environment variables using the “export” command. An environment variable is a dynamic value that can be accessed by programs and scripts running in the shell session. To set an environment variable, follow these steps: Open a terminal or shell session. Type “export” followed … Read more

[ERROR] /usr/local/libexec/mysqld: unknown variable ‘thread_concurrency=8’

The error message you are seeing indicates that the MySQL server is not able to recognize the “thread_concurrency” variable that is set to a value of 8 in the configuration file. The “thread_concurrency” variable was used in older versions of MySQL to control the number of threads that are used to process queries. To resolve … Read more

Faillog in Linux: Display Records of Login Failure

In Linux, the “faillog” command is used to display and manage records of login failures. The faillog command reads and displays information from the file /var/log/faillog, which stores the information about failed login attempts. Here’s how to use the faillog command to display records of login failure: Open a terminal and log in as root … Read more

Bash Shell Generate Random Numbers

In Bash shell, you can generate random numbers using the built-in “RANDOM” variable or the “shuf” command. Here’s how to do it: Using the RANDOM variable: Use the “$RANDOM” variable to generate a random number between 0 and 32767: echo $RANDOM This will output a random number each time you run the command. Use the … Read more

Linux / UNIX: Run Multiple X Sessions

In Linux or UNIX, you can run multiple X sessions (graphical sessions) simultaneously by using different virtual terminals (VTs). Here’s how to do it: Press “Ctrl + Alt + F2” (or any other function key from F2 to F7) to switch to the second virtual terminal. This opens a new login prompt. Log in with … Read more

Linux / UNIX: Displaying Today’s Files Only

To display only today’s files in Linux or UNIX, you can use the “find” command with the “-daystart” and “-ctime” options. Here’s how to do it: find /path/to/files -daystart -ctime 0 This command searches for files in the specified directory (/path/to/files in the example) that were created or modified within the last 24 hours. The … Read more