Linux just as important as ever in the modern world.

Windows 10 is the current operating system that Microsoft are pimping, but Linux is still very important. Servers run the free operating system, and there are many jobs that require Linux administration experience. The Windows 10 bash shell cannot run server software such as Apache and MySQL, this means that an actual Linux machine is … Read more

Location of the filesystem that the Windows 10 bash shell uses.

Location of the Windows 10 bash shell files This is the location of the actual files that are installed when you install the Windows 10 bash shell. This means that it is not really a ext4 filesystem, but emulating this when you load it up in a CMD window. %localappdata%\lxss\rootfs%localappdata%\lxss\rootfs The location of the actual … Read more

How to manipulate environment variables with the bash shell on Linux.

Manipulating environment variables in the bash shell is very useful indeed, this shows a few examples. This uses the feature of the Linux shell called parameter expansion. This replaces the name of an environment variable with it`s contents when echoed to the shell. These few examples show how the content echoed to the terminal may … Read more

Windows 10 bash shell not very impressive at all.

The new Windows 10 bash shell is not very impressive once you get it installed. I have tried it and I could not ping websites even though Microsoft Edge could access the Internet. It is possible to install packages if these lines are added to the /etc/hosts file. 91.189.91.14 archive.ubuntu.com 91.189.92.201 security.ubuntu.com91.189.91.14 archive.ubuntu.com 91.189.92.201 security.ubuntu.com … Read more

Windows 10 bash shell 10.0.14316 very good for getting system information.

The new bash shell in Windows 10 build 10.0.14316 is the best addition to Windows 10 yet. Here I am getting information about the CPU. root@localhost:/mnt/c/Users/johnc# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz stepping : 3 microcode : … Read more

Get information about your network connection with Linux.

This command will return only the IP address of the host. ubuntu ~ $ hostname -i 172.31.20.16ubuntu ~ $ hostname -i 172.31.20.16 Querying for all local IP addresses on the host. ubuntu ~ $ hostname -I 172.31.20.16 10.8.0.1ubuntu ~ $ hostname -I 172.31.20.16 10.8.0.1 This simple script will ping Google and will check the return … Read more

How to delete a directory on Linux.

Deleting a directory on Linux is very easy indeed. The rmdir command will perform this task adequately. You could also use the rm -rf abc/ command to delete a directory, but rmdir is easier to remember. eyjafjallajkull% rmdir abceyjafjallajkull% rmdir abc The rmdir command will not be able to delete a directory that is not … Read more

Create a cool looking clock in your terminal.

This simple little script will print an updating clock in the terminal. #!/bin/sh   watch -t -n 1 ‘date +%H:%M:%S | figlet’#!/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’#!/bin/sh watch -t -n 1 … Read more

More useful bash tricks for navigating your filesystem.

Navigating the Linux filesystem is very easy. The cd command is used to move to another directory. But there are other ways too. To navigate back to the last directory you were in, type cd -. This will take you back to where you were before. ubuntu /usr/share $ cd – /home/ubuntuubuntu /usr/share $ cd … Read more

How to mount the Ubuntu filesystem read-write when you have mounted the filesystem in recovery mode.

If you have appended this to the end of the grub command line to change a lost password: init=/bin/bash Ubuntu and you get this error. root@USB-h55-PC:~# passwd jason Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error passwd: password unchangedroot@USB-h55-PC:~# passwd jason Enter new UNIX password: Retype new UNIX password: passwd: … Read more

List hardware on your Linux system with some simple commands.

The lsdvb command will list all installed DVB hardware in your Linux system. Here it is showing my Realtek DVB stick. You need to use sudo to enable this command to gather more information. jason-H55-USB3 [lsdvb] ~/Documents jason-H55-USB3% sudo lsdvb   lsdvb: Simple utility to list PCI/PCIe DVB devices Version: 0.0.4 Copyright (C) Manu Abraham … Read more

How to change the default shell for new users on your Ubuntu Linux system.

The useradd command is used to add new users on your Linux system. But it can be used for other things too. You may display the defaults for new users. jason-H55-USB3% sudo useradd -D GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/sh SKEL=/etc/skel CREATE_MAIL_SPOOL=nojason-H55-USB3% sudo useradd -D GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/sh SKEL=/etc/skel CREATE_MAIL_SPOOL=no Use the -s parameter … Read more

A variant of the shellshock bug that still works with the bash 4.3.11 shell.

This is a variant of the shellshock bug for bash that still works on a patched system. I am using Ubuntu 14.04 and this still works for me. env VAR1=’me() {echo "hello"}\ ‘ /bin/touch /home/$LOGNAME/my.textenv VAR1=’me() {echo "hello"}\ ‘ /bin/touch /home/$LOGNAME/my.text So you can still put arbitrary content after the function definition in a bash … Read more

Check if you are vulnerable to the shellshock bug. This is an easy way to find out.

A vulnerable cygwin shell. Using the shellshock vulnerability to run ls in cygwin. Homer@bejiitas ~ $ x='() { :;}; `/bin/ls -hula`’ bash -c : bash: total 53K drwxrwxr-x+ 1 Homer Homer 0 Sep 26 18:38 . drwxrwxrwt+ 1 Homer Homer 0 Sep 26 2013 .. -rw-rw—- 1 Homer Homer 222 Sep 26 2013 .bash_history -rwxrwxr-x … Read more

Basic text filtering with sed. Very useful when you are manipulating text files.

This example uses sed to replace the beginning word of a sentence. Administrator@WIN-EM8GK0ROU41 ~ $ echo "this is a line of text." | sed "s/this/This/gi;" This is a line of text.Administrator@WIN-EM8GK0ROU41 ~ $ echo "this is a line of text." | sed "s/this/This/gi;" This is a line of text. This is a better way to … Read more