Linux Find And Report On File Fragmentation

You can use the filefrag utility to find and report on file fragmentation on a Linux system. filefrag displays the extent map of a file, which shows how the file is divided into fragments and where those fragments are located on the disk. Here’s how you can use filefrag: Install e2fsprogs package: sudo apt-get install … Read more

Yum Command Check and Apply Only Security Updates

You can use the yum command to check and apply only security updates on a Red Hat or CentOS system. The yum-security plugin provides this functionality. Here’s how you can do it: Install the yum-security plugin: sudo yum install yum-plugin-security Check for available security updates: sudo yum update-minimal –security Apply the available security updates: sudo … Read more

Debian Linux 6 Squeeze: Install Linux Kernel 3.2.xx

To install Linux Kernel 3.2.xx on Debian Linux 6 Squeeze, you need to perform the following steps: Download the Linux Kernel 3.2.xx sources: wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.2.xx.tar.xz Extract the sources: tar -xf linux-3.2.xx.tar.xz Change to the extracted source directory: cd linux-3.2.xx Configure the Linux Kernel: make menuconfig Build the Linux Kernel: make Install the Linux Kernel: sudo … Read more

Linux: Configure and Control APC SmartUPS During a Power Failure

The APC SmartUPS can be configured and controlled during a power failure on a Linux system using the apcupsd daemon and its associated utilities. Here’s how to set it up: Install the apcupsd package: On Debian/Ubuntu based systems: sudo apt-get update sudo apt-get install apcupsd On Red Hat/CentOS based systems: sudo yum install apcupsd Configure … Read more

Linux / Unix lftp Command To Mirror Files and Directories

The lftp command is a powerful file transfer tool for Linux/Unix systems that can be used to mirror files and directories between remote servers. Here’s an example of how to use the lftp command to mirror files and directories: lftp -e “mirror -c -R source_directory target_directory; quit” ftp://ftp.example.com Explanation: lftp is the command itself. -e … Read more

TCSH / CSH: set vs setenv Command Differences

The set and setenv commands in tcsh and csh shells are used to set environment variables, but with some differences: Syntax: The syntax for the set and setenv commands is different. set uses the following syntax: set variable = value while setenv uses the following syntax: setenv variable value Scoping: set sets a shell variable, … Read more