To add a subscription after installing Red Hat Enterprise Linux 7.2, type this command as root. [[email protected] jason]# subscription-manager register –username USERNAME –password “PASSWORD” This will setup your Red Hat subscription. Then enter this command. This will refresh all of the information on your machine. [[email protected] jason]# subscription-manager refresh And finally, run this command to …

A useful awk implementation to count the number of entries in the /etc/passwd file. [email protected]:~$ sudo awk -F: ‘{ print $1 }’ /etc/passwd | wc -l [email protected]:~$ sudo awk -F: ‘{ print $1 }’ /etc/passwd | wc -l 34 And the quintessential “Hello World” in Awk. [email protected]:~$ awk ‘BEGIN { printf "%s, %s\n", "Hello", "World!" …

The Caps Lock key may be toggled using the command line. The xdotool utility will do this for you. Firstly, install the utility. [email protected] ~ $ sudo apt install [email protected] ~ $ sudo apt install xdotool Then toggle the caps lock key with this command. [email protected] ~ $ xdotool key [email protected] ~ $ xdotool key …

The lsb_release -a command will print the Ubuntu version to the terminal. This is how you find out information about your Ubuntu installation. [email protected]:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.2 LTS Release: 14.04 Codename: [email protected]:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.2 …

This simple little script will print an updating clock in the terminal. #!/bin/sh watch -t -n 1 ‘date +%H:%M:%S | figlet’ This version will print a cow that tells you the time. #!/bin/sh watch -t -n 1 ‘date +%H:%M:%S | cowsay’ And finally, this prints the time using blocky characters. #!/bin/sh watch -t -n 1 …

This simple one-liner will print out all of the news headlines from the BBC news website in a simple text format. This is useful if you want to do something with a list like this. Or if you just want a listing to see if there is anything interesting happening. [email protected]:~$ curl -s http://feeds.bbci.co.uk/news/rss.xml | …

The mount command shows information about your mounted partitions on your machine. iMac305:~ admin$ mount /dev/disk0s2 on / (hfs, local, journaled) devfs on /dev (devfs, local, nobrowse) map -hosts on /net (autofs, nosuid, automounted, nobrowse) map auto_home on /home (autofs, automounted, nobrowse) map -fstab on /Network/Servers (autofs, automounted, nobrowse) /dev/disk0s3 on /Volumes/Scratch (hfs, local, journaled)iMac305:~ …

This sed trick will filter out the unwanted characters and leave only the letters ‘A’. [email protected] ~ $ echo "###AAA" | sed ‘s/###//gi’ [email protected] ~ $ echo "###AAA" | sed ‘s/###//gi’ AAA This is how to re-bind the annoying CAPS-Lock key to Esc. This can give that key a new use. xmodmap -e ‘clear Lock’ …

Changing the hostname on a Linux system is very easy indeed. Use this command to set a new hostname. [email protected]:~$ sudo hostname netbook.local Then edit the /etc/hosts file to set the new hostname. [email protected]:~$ sudo vim.tiny /etc/hosts And edit it to the new value. 127.0.0.1 localhost 127.0.1.1 netbook.local # The following lines are desirable for …

The caps lock key on Linux is very annoying when hit accidentally. Especially when you are typing a password. This simple command will disable the key permanently. [email protected] ~ $ setxkbmap -option ctrl:nocaps If you put this in Startup Applications which may be found under System-Preferences-Startup Applications, the caps lock key will be disabled when …

The toilet command prints out large text banners like the Figlet command. Here is an example. The banner is printed in color. [[email protected] flynn]$ toilet –metal “Hello World.” m m “”# “”# m m “”# # # # mmm # # mmm # # # mmm m mm # mmm# #mmmm# #” # # # …