Unix: csh Shell Loop Example

In the csh shell, you can use a loop to perform a set of commands multiple times. Here are a few examples of loops in csh: For loop: #!/bin/csh set i = 1 while ( $i <= 10 ) echo “Iteration $i” @ i++ end This script will print “Iteration 1” to “Iteration 10”. For … Read more

FreeBSD 9.1: HowTo Load a Kernel Module

In FreeBSD 9.1, you can load a kernel module using the kldload command. Here’s the basic syntax to load a kernel module: kldload <module-name> For example, to load the if_bge module, use the following command: kldload if_bge Once the module is loaded, you can use the kldstat command to verify that the module is loaded: … Read more

Debian / Ubuntu: apt-get force reinstall package

To force reinstall a package using apt-get on Debian or Ubuntu, you can use the following command: sudo apt-get install –reinstall <package-name> For example, to reinstall the nginx package, use the following command: sudo apt-get install –reinstall nginx The –reinstall option tells apt-get to reinstall the specified package, even if it is already installed and … Read more

Bash Display Web Page Content In Terminal

To display the content of a web page in the terminal, you can use the curl command. Here’s the basic syntax to display the content of a web page: curl <URL> For example, to display the content of the Google homepage, you can use the following command: curl https://www.google.com This will print the HTML code … Read more

CentOS / RHEL: Install KornShell (KSH)

To install the KornShell (KSH) on CentOS or Red Hat Enterprise Linux (RHEL), you can use the following steps: Update the package list: $ sudo yum update Install KSH: $ sudo yum install ksh Verify the installation: $ which ksh The which command will display the location of the KSH executable if it’s installed. After … Read more