Deleting files on your Linux machine that have strange names. And how to use wildcards on the shell.

I ran a Perl script on my system that created a bunch of files on my computer named as shown below. I could have typed rm -f A* but that could have deleted other files that have a capital “A” as the first letter of the filename. That is where wildcards come into play. I … Read more

How to print out a list of all BBC news headlines with the command line. This is very cool.

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. Updated command for 2017, as … Read more

Using the chmod command to change file permissions on a UNIX/Linux system.

Using the chmod command to change file permissions on a UNIX/Linux system. -rw-rw-r– 1 john john 203 09-02-12 07:16 pm out.out-rw-rw-r– 1 john john 203 09-02-12 07:16 pm out.out This file listing detail shows the information about the current file. The listing -rw-rw-r– shows the permissions for user, group and world. In this example, the … Read more

How to prevent a file from being overwritten using the tcsh shell on Linux.

How to use noclobber with the tcsh shell on UNIX and Linux This example using the set noclobber command prevents existing files from being overwritten. 2:04am ubuntu /home/ubuntu ~> set noclobber2:04am ubuntu /home/ubuntu ~> set noclobber Now if I try to redirect to the file, this happens. 2:04am ubuntu /home/ubuntu ~> echo "" > chan.c … Read more

Useful Linux information and good reading for Linux users.

Useful Linux e-books and further reading for Linux users Guide to the Linux command line: http://www.securitronlinux.com/lc/Linux-Command-Line-Guide%20.png. Useful guide to the Linux command line for Linux newcomers. Guide to Linux permissions. How to set the permissions for Linux files with the command line: http://www.securitronlinux.com/lc/112_sysadmin_permissions.pdf. Debian Linux handbook. Useful information and tips for Linux newcomers: http://www.securitronlinux.com/lc/debian-handbook.pdf. Ubuntu … Read more

How to make the title bars in Gnome Shell much thinner than the default.

The title bars in the Gnome Shell desktop environment by default are much too thick. This simple code sample will make them thinner. Just create this file. ~/.config/gtk-3.0/gtk.css~/.config/gtk-3.0/gtk.css Then put this code into it. Updated for Gnome Shell on Ubuntu 18.04. # Gnome 3 – based on https://blog.samalik.com/make-your-gnome-title-bars-smaller/ .header-bar.default-decoration { padding-top: 1px; padding-bottom: 1px; font-size: … Read more

Understanding the /etc/passwd file on UNIX/Linux.

The /etc/passwd file on UNIX/Linux is where the user accounts for Linux are stored. This keeps your system safe as the passwords are stored as hashes in the /etc/shadow file, which is separate from the passwd file and is only accessible by the superuser. This keeps a system very safe. Red Hat Enterprise Linux uses … Read more

Useful Linux shell tricks. Using Brace expansions to create folders.

The Linux command-line offers many useful methods of creating many folders on your computer at once.  This command will create a few folders on your system named one,two,three,four and create the folders five,six,seven,eight within each folder created. ~$ mkdir -p {one,two,three,four}/five/six/seven/eight~$ mkdir -p {one,two,three,four}/five/six/seven/eight This command will create four folders named one,two,three,four and put the … Read more

How to embed the output of a command into a bash script.

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"echo "Hello $(whoami), the date is $(date -u). Have a nice day" This is the output this will give you. ┌─[jason@neo]─[~] └──╼ $echo "Hello $(whoami), the … Read more

How to create a dot matrix printer banner with Linux and other useful Linux tricks.

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

Evolution of operating system menus from early Gnome to Gnome Shell.

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 … Read more

Some interesting and useful Linux commands and BASH tricks.

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

How to list the installed files of a certain package and other useful tips.

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 … Read more