Embedding the output of a command into a bash shell script is quite easy. Here is an example. echo “Hello $(whoami), the date is $(date -u). Have a nice day” This is the output this will give you. ┌─[[email protected]]─[~] └──╼ $echo “Hello $(whoami), the date is $(date -u). Have a nice day.” Hello jason, the …

The printerbanner command will create a dot matrix printer banner. Just run the command and then type a string and hit ENTER. [email protected]:~$ printerbanner Message: [email protected]:~$ printerbanner Message: Debian Print out the contents of a text file in octal format. [email protected]:~$ od .dmrc 0000000 042133 071545 072153 070157 005135 060514 063556 060565 0000020 062547 062475 …

The early Gnome desktop is quite interesting, it had a Windows styled menu with a easy to use taskbar. https://www.ocf.berkeley.edu/~bobk/gnome/1.2/gnome-1.2-menu02.png. Source: https://www.ocf.berkeley.edu/~bobk/gnome/. This is the old Gnome 1.0 configuration application. Very dated indeed, this is when they had Enlightenment as the Window Manager of Gnome. Although you could use Sawfish as well. http://www.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/031/3139/3139f1.jpg. The Gnome …

Gnome Shell themes Tron Legacy Gnome Shell theme. http://www.linuxnov.com/tron-legacy-theme-for-gnome-shell/. This is a Gnome Shell theme inspired by the Tron Legacy movie. MetalX Gnome Shell theme for Linux. https://www.deviantart.com/art/Metal-X-theme-v-2-1-for-Gnome-3-16-577064989. Android Flat Gnome Shell theme. A nice flat grey theme for your Gnome desktop. https://www.deviantart.com/art/Android-Flat-3-18-565622252. Ambiance Gnome. https://www.deviantart.com/art/Ambiance-Gnome-3-14-1-8-GNOME-Shell-theme-476996106. An Ubuntu inspired theme for any Gnome Shell desktop. …

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!" …

To list all the files installed by a certain Debian package, use this command. dpkg -L [PACKAGENAME]. For example. ubuntu ~ $ dpkg -L vim /. /usr /usr/bin /usr/bin/vim.basic /usr/share /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/vim /usr/share/bug /usr/share/bug/vim /usr/share/bug/vim/presubj /usr/share/bug/vim/script /usr/share/doc /usr/share/doc/vimubuntu ~ $ dpkg -L vim /. /usr /usr/bin /usr/bin/vim.basic /usr/share /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/vim /usr/share/bug /usr/share/bug/vim /usr/share/bug/vim/presubj …

The bash shell has some very useful features when using the command line. This can make using the command line much faster. For example, if you forget to type sudo before a command, this can be fixed this way. jason$ fdisk -l /dev/sda fdisk: cannot open /dev/sda: Permission deniedjason$ fdisk -l /dev/sda fdisk: cannot open …

To easily get system information, install screenfetch on Linux and this will be easy. Install screenfetch. sudo apt install screenfetchsudo apt install screenfetch Then run it to get system information easily. This is a good way to show off your system specifications. jason$ screenfetch [[ ! ]] Gtk-Message: Failed to load module "topmenu-gtk-module" ./+o+- [email protected]

This command will capture a screenshot of the desktop and save it to the home directory. [email protected]:~$ import -window root "$HOME/$(date ‘+%y%m%d_%T’).png"[email protected]:~$ import -window root "$HOME/$(date ‘+%y%m%d_%T’).png" This is how to do this with the scrot utility. [email protected]:~$ scrot Desktop-%H:%M:[email protected]:~$ scrot Desktop-%H:%M:%S-%d-%m.jpg Characters preceded by a ‘%’ are interpreted by strftime(2). See man strftime for …

The useradd command can create a new user on your Linux system. Here is how to add a password as well all in one simple operation. [email protected]:/home/jason# useradd -m -s /bin/bash -g users -p $(openssl passwd -1 ff302) [email protected]:/home/jason# useradd -m -s /bin/bash -g users -p $(openssl passwd -1 ff302) randycole This is a good …

This is a nice script to build a custom PS1 that looks awesome and is simple too. export PROMPT_COMMAND=__prompt_command function __prompt_command() { local EXIT="$?"   local DEFAULT=’\[\e[0m\]’   local RED=’\[\e[0;31m\]’ local GREEN=’\[\e[0;32m\]’ local DARK_GRAY=’\[\e[0;90m\]’ local PURPLE=’\[\e[0;35m\]’ local YELLOW=’\[\e[0;33m\]’   PS1="\n${GREEN}\t${DEFAULT} "   if [ "$EXIT" != "0" ]; then PS1+="${RED}$EXIT${DEFAULT} " else PS1+="$EXIT${DEFAULT} " fi …

To print a graphical notification from a shell script, insert this code. notify-send "Match Found!"notify-send "Match Found!" This will pop up a notification on your desktop, this will alert you to the fact that your shell script has done something. Make your computer talk. This will speak whatever you type as text. [email protected]:~$ espeak "I …

Search and replace on the bash shell is very useful for various one-liner shell commands. The below example shows how to replace a # character with a * character. [email protected]:/mnt/c/Users/johnc/Documents$ cat ip.c | sed ‘s/#/*/gi;’ *include <stdio.h>   int main() { printf(".");   return 0; }[email protected]:/mnt/c/Users/johnc/Documents$ cat ip.c | sed ‘s/#/*/gi;’ *include <stdio.h> int main() …

To list all non-free Linux packages that are installed on your Linux Mint system, use this one-liner. This prints out a list of all non-free packages that are installed on a system. [email protected] ~ $ dpkg-query -W -f ‘${Section}/${Package}\n’ | grep -E ‘^(contrib|multiverse|non-free|partner|restricted)/’ | sort contrib/kernel/virtualbox-guest-dkms contrib/misc/virtualbox-guest-utils [email protected] ~ $ dpkg-query -W -f ‘${Section}/${Package}\n’ | …

This one-liner will convert binary numbers to decimal. Very easy to do in the bash shell. [email protected]:~$ echo "$((2#01110100011000010110101101))" [email protected]:~$ echo "$((2#01110100011000010110101101))" 30508461 This is how to convert binary to Hexadecimal. [email protected]:~$ printf ‘%x\n’ "$((2#1111111))" [email protected]:~$ printf ‘%x\n’ "$((2#1111111))" 7f These very useful one-liners should make converting number values even easier then ever before.