Tag Archives: bash

Count the number of sub-directories

Another one liner that just counts the number of sub directories. $ find ./*  -type d  | wc -l Note – Remember to use ./* if you don’t want to include the current directory itself in the total. Advertisements

Posted in Linux | Tagged | Leave a comment

Script to set the MTU size in RedHat

The following script makes it easy to set the MTU size if you are using RedHat or CentOS 7.x, and has also been tested successfully on RedHat 6.x.

Posted in Linux, Networking, RedHat | Tagged | Leave a comment

Determine MTU size using ping

Normally the MTU size should be set correctly using Path MTU discovery, but this may not always work.

Posted in Linux, Networking | Tagged , , , , | Leave a comment

Removing version numbers from … well anything

This one liner can remove the version numbers from any string (providing they start with a hyphen and a digit).

Posted in CentOS, Linux, RedHat | Tagged | Leave a comment

Using RPM to find package dependencies

I recently discovered that is it actually rather difficult to determine which packages depend on a particular package using the RedHat Package Manager, and I ended up writing a short script to list all the dependencies for a particular package.

Posted in CentOS, RedHat | Tagged , | Leave a comment

Comparing lists of things…

Obviously when I want to compare two files I’m going to use  diff .

Posted in Linux | Tagged | Leave a comment

Downloading files using Wget

Or how to use up a lot of disk space real quick…!

Posted in Linux | Tagged , | Leave a comment

Check OS version (Debian/Ubuntu/Raspbian)

There are several ways to check which version of Debian, Ubuntu or Raspbian you are running.

Posted in Debian, Linux, Raspbian, Ubuntu | Tagged , , , , , , | Leave a comment

Executing commands on a remote machine using SSH

You can use ssh to execute a command on a remote machine, in this case to shut it down, which can be particularly useful if you want to turn off a Pi gracefully but don’t have a keyboard or screen … Continue reading

Posted in Linux | Tagged | Leave a comment

Download installed packages

This script will determine what packages you have installed and download a copy of each package to you current folder.

Posted in Debian | Tagged , , , | 1 Comment