Home » 2021

Show Privileges in MySQL/MariaDB using SHOW GRANTS, With Examples

MySQL Show Privileges

This article will show you, with examples, how to show what database privileges users have in MySQL and MariaDB. List All Users To show the privileges for a user, you need to be able to query the user’s name. Here’s how to generate a list of all users on a MySQL server: SELECT user FROM mysql.user; …and here’s how to list all users, with the host they are allowed to connect from: SELECT user, host FROM mysql.user; Both of the above queries pull information from … Read more

Home » 2021

cat Command in Linux/Bash – How to Use It, With Examples

cat Command Linux Bash

The cat (concatenate) command in Linux/Bash is most commonly used to read the contents of a file. It outputs the contents of a given file. Here’s how to use it. cat concatenates files to standard output – by default, this is to the console for viewing on your computer screen. This makes it useful for quickly viewing the contents of files. It also has other uses, but first, the syntax: cat Syntax cat [OPTIONS] [FILE] Note that: If FILE is not specified, will read from standard input (stdin) Multiple FILEs can be specified, separated by … Read more

Home » 2021

Running Ubuntu in VirtualBox on Windows/Mac [Tutorial]

Running Ubuntu In VirtualBox

Here’s a straightforward set of instructions (with lots of screenshots) on how to set up Ubuntu Linux in VirtualBox for running Ubuntu in a Virtual Machine on Windows 10 and macOS. VirtualBox allows you to set up and run virtual machines on your computer easily.  A virtual machine is a whole computer, virtualized running on top of your current operating system – allowing you to try out and experiment with new operating systems and tools without reformatting your computer. Download and Install Virtualbox The first … Read more

Home » 2021

Getting the Absolute (Full) and Relative Path In Linux

Absolute Paths in Linux

This article explains absolute paths and how they differ from relative paths, getting them, and how symbolic links are handled. FileSystem Paths A path is the location of a file in a file system. It’s the directions to the file in the folder it is located. A path consists of a string of characters. Some represent directory names, and a separator character separates the directory names from the file name and extension. Consider the below path: /path/to/my/file.txt It consists of: Forward slashes (/) to separate directories from their subdirectories … Read more

Home » 2021

Redirect stdin, stdout, stderr in Linux/Bash, With Examples

Redirect stdin, stdout, stderr in Linux & Bash

The Linux/Bash shell has three data streams that you can tap into when executing commands – stdin, stdout, and stderr. Here’s how to use them. stdin, stdout, stderr allow for the display of text in the console, and the data being output each stream can be directed into other programs. These are referred to as Standard Streams. What is stdin (Standard Input)? Text input stream. Applications can accept text via stdin as input. What is stdout (Standard Output)? The text output stream of a program. Applications send data to other programs (or to the console for viewing) via stdout. … Read more

Home » 2021

Remove a User From the Linux Command Line/Shell – How to Do It

Linux Remove User

Here’s a short and sharp article on how to remove a user from a Linux system. These examples will work on the majority of Linux distributions. The userdel Command The userdel command can be run from the Linux shell to remove a user. Here’s the syntax: userdel OPTIONS USERNAME Note that: OPTIONS should be from the below table USERNAME should be the login username of the user to be deleted userdel requires administrative rights and will need to be run as root or using the sudo command BE AWARE – RUNNING ANY userdel … Read more

Home » 2021

Why You Should Use Linux in 2021

Why Use Linux 2021

Here’s a bunch of reasons to try out (or continue using) Linux in 2021. Lots has changed on the Linux front in the last decade – here’s why you should give Linux a go. I’ve been using Linux on desktop computers since the early 2000s – starting out with Corel Linux. Early distributions had big fallbacks for the average user – mostly to do with compatibility with Windows machines. While it was already best-in-class for running servers and developing software, creating and sharing images and … Read more

Home » 2021

Calculating Absolute Values in Python, With Examples

Python Absolute Value

In this article, you’ll learn about absolute values – what they are, how they’re used, and how to use the Python abs() function to calculate them. What is the Absolute Value of a Number? The absolute value of a number is that number’s value without any regard to its sign. A number’s sign is whether it is positive or negative. So, the absolute value of a number is never negative. To make it simple, consider the absolute value of a number that numbers distance from 0. It is also referred to in mathematics and … Read more

Home » 2021

Concatenate Strings in Bash/Shell Scripts, With Examples

Bash Concatenate Strings

Here’s a short article on concatenating (merging) strings in Bash – the right way. Examples included. There are various ways two or more strings could be joined in a shell script. Various programs will accept strings and return them merged/concatenated – but using the side-effect of a programs operation to concatenate strings is a bit of a waste of time, so this article will focus on the simplest, most readable method. Inserting a String into Another A string can be inserted when creating another string … Read more

Home » 2021

Command Line Arguments in Python Scripts, With Examples

Python Command Line Arguments

This article will show you simple methods to pass command line arguments to your Python scripts, with some examples. Passing arguments to your script makes it easy to build multi-use scripts that can work on different inputs. This is much easier than re-editing your code every time you want to change the inputs it will be working on. I’ve previously covered building a full command-line application in Python, which accepts command-line options and bundles the application into a distributable package with no external dependencies – … Read more