How the bash shell works in Linux.

If you’ve ever piped the output of one command into the input of the other or joined simple commands together to do complex tasks, then you have a taste for the power of the shell. As you use the shell more and more you’ll discover how powerful it is and…

Read More

How to have a blinking $ sign in your Linux prompt. This is very interesting indeed.

This is my current Linux shell prompt. This will show the current Github branch if you are in the folder containing a Git project. But I have added something cool. git_branch() { git branch 2> /dev/null | sed -e ‘/^[^*]/d’ -e ‘s/* \(.*\)/(\1)/’ }   PS1=’┌──[\[\033[38;5;160m\]\u\[$(tput sgr0)\]@\[$(tput sgr0)\]\[\033[38;5;75m\]\H\[$(tput sgr0)\]]─[\w]\n└──╼ $(git_branch)…

Read More

A much better way to save audio from Youtube with youtube-dl.

Saving music from Youtube is fun. I am going to show how to save in good quality using youtube-dl by itself. This command will do it in one go. youtube-dl -f 140 https://www.youtube.com/watch?v=eb-2ljQDYFU –embed-thumbnail –extract-audio –audio-format mp3youtube-dl -f 140 https://www.youtube.com/watch?v=eb-2ljQDYFU –embed-thumbnail –extract-audio –audio-format mp3 This is the command in action….

Read More

Some very useful Linux tips and tricks.

To read a file from the Internet using wget and print it in the terminal, use this command. ┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.mjh.nz/au/Brisbane/raw-tv.m3u8┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.mjh.nz/au/Brisbane/raw-tv.m3u8 View an image from the Internet with wget and the ImageMagik display utility. ┌─[jason@jason-desktop]─[~/Documents] └──╼ $wget -qO – https://i.4cdn.org/g/1603231784644.png | display┌─[jason@jason-desktop]─[~/Documents]…

Read More

How to get information about a video file with the Linux command line easily.

Getting information about a video file on Linux with the command line is very easy. I will show how you can easily find the resolution of a video and the format. This example below will return the resolution of a video file. jason@jason-desktop:~/Videos$ ffprobe XR_3DA_2019_03_16_19_22_35_777.avi 2>&1 | grep -E ‘[[:digit:]]{3,}x[[:digit:]]{3,}’…

Read More

How to easily get information about your CPU on Linux.

Getting information about your CPU on Linux is very easy. There are many ways to do this. The cpufreq app is one good way to get the current CPU frequency. 4.4 Thu Jun 04 jason@Yog-Sothoth 0: $ cpufreq-info -f -m 988 MHz4.4 Thu Jun 04 jason@Yog-Sothoth 0: $ cpufreq-info -f…

Read More

Set a very nice Linux shell prompt and very useful aliases.

This addition to your .bashrc file will give you a very nice shell prompt and colorful output of the ls command. This looks very stylish indeed. # set variable identifying the chroot you work in (used in the prompt below) if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ];…

Read More

How to print a list of all ABC News articles with the Linux command line.

This one-liner will print a listing of all ABC News articles from the XML RSS feed. This is a very good way to extract text from an RSS feed or other XML files. curl -s http://www.abc.net.au/news/feed/2942460/rss.xml | grep ‘media:description’ | awk -F "[<>]" ‘{print $3}’; echo "$desc"curl -s http://www.abc.net.au/news/feed/2942460/rss.xml |…

Read More

How to get a nice DOS styled shell prompt for fun in Linux.

This PS1 example gives the user a pretend DOS shell prompt. This is very interesting and would be fun to play with for an experienced user, or to complete a Windows themed desktop environment like Cinnamon. That can be made to look just like Windows 10. And with this shell…

Read More

Very useful Linux bash shell tricks.

There are many very useful shell tricks when using the bash shell on Linux or UNIX. Print the last used command-line arguments with a keyboard shortcut. ESC-. This will print the last used command-line arguments to the prompt. Very useful if it is a very long one-liner. Print a listing…

Read More

Miscellaneous Linux commands. Some useful tips for the Linux BASH prompt.

The ldd command will print out a list of all libraries that an executable is linked against. This is the output for a simple “Hello World” command. 20:15:31 tux@linux-v415 ($ ldd ./a.out linux-vdso.so.1 =&gt; (0x00007fff171ff000) libc.so.6 =&gt; /lib64/libc.so.6 (0x00007fe56ef58000) /lib64/ld-linux-x86-64.so.2 (0x00007fe56f2e8000) 20:15:49 tux@linux-v415 ($20:15:31 tux@linux-v415 ($ ldd ./a.out linux-vdso.so.1 =&gt;…

Read More

Some very useful bash scripting tips for testing the output of a program.

This simple shell script will test your Internet connection and then tell you if it is up or not. wgetvar=$(wget -q –tries=3 –timeout=20 –spider http://google.com)   if [ $? -eq ‘0’ ] then echo "Internet is up." else #some logging echo "Internet is down.." fiwgetvar=$(wget -q –tries=3 –timeout=20 –spider http://google.com)…

Read More

Very useful Linux shell tips and tricks.

Add a new directory to the PATH to allow running an application from it without typing the full path every time you wish to run it. PATH=$PATH:/usr/local/binPATH=$PATH:/usr/local/bin Or you may have something like this in your .bashrc to add this every time you log in. PATH="/home/jason/perl5/bin${PATH:+:${PATH}}"; export PATH;PATH="/home/jason/perl5/bin${PATH:+:${PATH}}"; export PATH;…

Read More

Misc BASH shell tricks for the Linux user.

To recall the last entered command on the Linux console, press the Ctrl-P key shortcut. You may also press the up arrow to recall the command, but the Ctrl-P shortcut is another good way to perform this feat. The CTRL-A shortcut will jump to the beginning of the line you…

Read More