Installing Powershell for Linux in Ubuntu 16.04 is very easy. I had problems with the packages, but I sorted it out very quickly. Firstly, download the Powershell Debian package. https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell_6.0.0-alpha.9-1ubuntu1.14.04.1_amd64.deb. Then the required libicu package. http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-3ubuntu0.4_amd64.deb. Then install the libicu package. jason$ sudo dpkg -i libicu52_52.1-3ubuntu0.4_amd64.deb Selecting previously unselected package libicu52:amd64. (Reading database … 490392 …

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 …

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() …

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.

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 …

Windows 10 is getting a bash shell in the summer release. This is a couple of months away. But here are a couple of screenshots from developers I have found on the web that show what this will look like. Here a person is installing the bash shell using CMD. Now this is the bash …

Apparently, the Linux bash shell is coming to Windows 10. This will offer a fully functional Linux bash prompt in the Windows app store, a good alternative to Powershell. This is in partnership with Canonical who work on the Ubuntu Linux distribution. As long as this offers tools such as dig, wget, and whois, it …

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 …

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 …

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. [email protected]:~# passwd jason Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error passwd: password unchanged Then you may fix this by remounting the filesystem read-write. Accomplish …