Home » Linux » Shell

How to Quickly Check your Ubuntu Version [Easy]

Check your Ubuntu Version

It’s important to stay up to date – both for security and compatibility reasons and because it’s always nice to have the latest features in your Linux Operating System. To find out which Linux distribution, and version of that distribution you’re using, use one of the below methods on both the server and desktop versions of Ubuntu based systems: Getting Your Ubuntu Version by reading from the /etc/issue file Type the following into your terminal to read the contents of the file /etc/issue into your terminal: cat /etc/issue You’ll get … Read more

Home » Linux » Shell

Bash For Loop [With Examples]

Bash For Loop

The for loop is a handy tool when writing Bash scripts for repeating a task for a number of files, records, or other values. The for statement will iterate over a list of values, performing tasks on each one until all items have been processed. Usage cases include looping over the files in a directory, the lines in a text file, or the output of a database query. Bash For Loop Syntax for VARIABLE in LIST do COMMANDS done Where: VARIABLE is the variable name that will … Read more

Home » Linux » Shell

Linux wget Command Guide [With Examples]

Linux wget Command

If you followed our Magic Mirror tutorial, you’d see the wget command was used to download some files. This tutorial explains how to use wget, a command-line tool for downloading (getting) files from the web, be it via HTTP, HTTPS, FTP, or FTPS. Use it to download files from the internet from the Linux shell, call it from Bash scripts – it’s simple and versatile and doesn’t require user interference once started so that it can run in the background. Syntax wget [OPTIONS]… [ URLS ]… … Read more

Home » Linux » Shell

How to Use the Dig Command [With Examples]

How to Use the Dig Command

dig is the Linux command-line tool used to look up the DNS records for a host. This tutorial explains how to use this command and includes handy examples. DNS records provide information to your computer about a host’s IP address on a network, email configuration, or other text data that can be associated with the host. DNS records provide the street directory for the internet. When you access a website, your computer looks up the DNS record associated with the website’s domain to get the IP … Read more

Home » Linux » Shell

apt vs apt-get Commands – What’s the Difference?

apt vs apt get Commands

This guide explains the differences between apt and apt-get commands, so you can decide which one to use. Historically, you’ve probably installed software on Debian based Linux Operating Systems (like Ubuntu) using the apt-get command. More recently you’ve probably seen the apt command being used in its place in various places online, but with otherwise much the same syntax. For example: sudo apt-get install nano has the same effect as sudo apt install nano which is to install the nano text editor package on your system. So … Read more

Home » Linux » Shell

The Linux Shutdown (& Reboot) Command

Linux Shutdown

The shutdown command in Linux shuts down your computer safely. All users and processes will be notified, and processes are given the chance to exit safely. The shutdown command can also reboot and bring the system to other power levels. Syntax shutdown [OPTION]… TIME [MESSAGE] Options Here are the available options for the shutdown command, straight from the manual: Option Description -r Requests that the system be rebooted after it has been brought down. -h Requests that the system be either halted or powered off after it … Read more

Home » Linux » Shell

How to Check if a File or Directory Exists in Bash [+ Examples]

bash check if file exists

You can check whether a file or directory exists on a Linux system using the test command in bash. See our examples below to find out how. The test Command Syntax test EXPRESSION The test command will evaluate the EXPRESSION. Expressions can be built using the following operators and can be built using a combination of operators. -d file True if file is a Directory. [[ -d demofile ]] -e file True if file Exists. [[ -e demofile ]] -f file True if file is a regular File. [[ … Read more

Home » Linux » Shell

How to SSH Into Your Raspberry Pi Remotely [Simple Guide]

How to SSH Into Your Raspberry Pi

Here’s a summary of the options available for connecting to your Raspberry Pi via SSH – from Linux, macOS, and Windows. Networking We’ll assume you have your Pi on your network – wired or wirelessly. Static IP Address vs DHCP Your Raspberry Pi will most likely be configured to receive an IP address via DHCP (Dynamic Host Configuration Protocol), which means your router assigns an available address to your Pi. As it’s assigned automatically, you won’t know what it will be in advance. If you’ve … Read more

Home » Linux » Shell

Making POST Requests with cURL

post requests curl

cURL is a package that contains various tools for transferring data between remote servers. It supports FTP, Windows Shares, Mail Servers, and of course Web Servers using HTTP. Downloading a file from the Linux shell is usually accomplished using the cURL command like so: curl http://example.org/file.zip –output file.zip This makes the request for the file using the GET method and simply downloads it. This article will detail how to use cURL to make a POST request, including form data. This may be useful if the server requires … Read more

Home » Linux » Shell

Linux cd Command: Change Directory

Linux cd Command Change Directory

This tutorial explains how to use the cd command in Linux to change the directory you are currently in, within the shell. We’ve previously covered how to look around in directories with ls. But now you need to start navigating around the directories. We’ll do that easily with cd, change directory. Let’s start with something simple, how do we learn more about simple baked in utils like cd? If you try: man cd It’ll report, “No manual entry for cd”. Most likely. Instead for baked … Read more