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.

Dragonfly BSD. One very secure operating system.This is running in qemu, the emulator for PC operating systems. It is a live CD and has the option to install the operating system or use the system as root. Once logged in you can use gcc and vi, all the familiar UNIX/GNU tools. I could get to …

Generate secure passwords for your user accounts The pwgen command will generate a set of random passwords that may be used to secure your user account. Type this command to install this utility. [email protected]:~# apt-get install [email protected]:~# apt-get install pwgen Now we can generate a few passwords. [email protected]:/mnt/c/Users/johnc$ pwgen -s -v 79lZrgzb ctklTCV3 zX3nDCQr FXk5g7V8 …

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 …

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. [email protected]:/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 : …

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 …

The shuf command for Linux allows a command-line user to select a given number of random words from a wordlist. [[email protected] ~]$ shuf -n 8 /usr/share/dict/words amphivasal thoracically U. bluet Dabih thioamid taxiing convictism[[email protected] ~]$ shuf -n 8 /usr/share/dict/words amphivasal thoracically U. bluet Dabih thioamid taxiing convictism This can be used to generate a word …

This function will allow your computer to speak. function shellspeak() { mplayer “http://translate.google.com/translate_tts?tl=en&q=$(echo $@ | sed ‘s/\s/+/’)” > /dev/null 2>&1; } A script that will change all files in a directory to lowercase filenames. function lowercase() # move filenames to lowercase. { for file ; do filename=${file##*/} case “$filename” in */*) dirname==${file%/*} ;; *) dirname=.;; …

The wall command is a perfect way to send a message to all logged on users on a Linux machine. This is used when you shutdown to alert all users that the system will be shutting down. The example below shows me sending the output of the ps command to all users. [email protected]:~$ sudo ps …

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 …

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 …