My PyQt GUI book Create Simple GUI Applications has been updated, with new chapters on Qt Designer and multithreading. Get it here.

Customize directory colors

You can use the command ls --color (or an alias) to show directories with colours for folders, files, links, etc. However, you may not realise these colours can be easily configured using bashrc and a configuration file.

Collaborate in the shell with screen (multiuser)

Screen is a neat little program that allows you to use multiple virtual terminals in a single session on Unix/Linux and Mac. However, it does more than just that. It can also allow you to share your current session on a machine with another user - allowing you to collaboratively hack away at a problem in real time.

Bash Command Substitution

Bash command substitution performs a given command replacing the marker with the resulting standard output. It is particularly useful when you want to store the output of a command in a variable or as an alternative method of chaining multiple commands together.

Remove duplicate lines from text files (with sort)

A quick method to remove duplicates from text files - including for example CSV files - where multiple records have been added (perhaps automatically) at different times resulting in multiple copies of the same record scattered throughout the file. Here is a simple one-liner bash command to remove duplicates using sort.

Set CDPATH to ease folder navigation

CDPATH is an environment variable which tells the cd command where to look for the specified folder. By including the parent folders of commonly used locations you can access folders more easily - and without typing an entire path.

Use ifconfig.me to return your IP and Host

ifconfig.me is a web service that displays information about your connection, including IP address, hostname and User Agent string. Helpfully it provides a simplified interface that can be easily queried to get this information from the command line.

Use screen to manage persistent sessions

GNU Screen is a command-line application that allows use of multiple virtual sessions within a single real terminal or remote session. Importantly, it allows for persistent running of command-line applications independent of the shell that initiated them program, meaning active applications can persist during disconnection.