Linux Disable Wireless Networking ( Wi-Fi )

To disable wireless networking (Wi-Fi) on Linux, you can follow these steps: Open a terminal window on your Linux machine. Type the following command to list the available network interfaces: ifconfig Identify the wireless interface from the list of available network interfaces. It will typically have a name like “wlan0” or “wlp2s0”. Type the following … Read more

Shell Script While Loop Examples

Here are a few examples of while loops in shell scripts: Example 1: Counting from 1 to 10 #!/bin/bash count=1 while [ $count -le 10 ] do echo $count count=$((count+1)) done This script initializes a variable called count to 1 and then uses a while loop to print the value of count and increment it … Read more

Mac OS X Start / Stop / Restart Apache Web Server

On Mac OS X, the built-in Apache web server is managed using the httpd command. You can use the following commands to start, stop, and restart the Apache web server: Start Apache: sudo apachectl start Stop Apache: sudo apachectl stop Restart Apache: sudo apachectl restart Note that these commands require administrative privileges, so you’ll need … Read more

Mac OS X: Restart / Stop / Start Apache2

On Mac OS X, you can use the following commands to restart, stop, and start Apache2: Restart Apache2: sudo apachectl restart Stop Apache2: sudo apachectl stop Start Apache2: sudo apachectl start These commands require administrative privileges, so you’ll need to enter your password when prompted. Additionally, if Apache2 is not installed on your system, these … Read more

Bash Substring Verification

Bash provides various mechanisms for working with substrings. Here are some common ways to verify if a substring exists within a string: Using grep command: if echo “$string” | grep -q “$substring”; then echo “Substring found” else echo “Substring not found” fi Using Bash’s built-in pattern matching: if [[ $string == *”$substring”* ]]; then echo … Read more