The ls command on Linux is one of the most essential command line tools that all users should familiarize themselves with. When navigating directories on the command line, the ls command is used to list the contents of a directory. Without this command, we can't know what files are on our system. Once you learn how to use this command, the knowledge will carry over to any Linux distribution, since ls is a longtime staple on all of them.

ls becomes even more handy once you learn some of its options. Newcomers to Linux may intuitively think that browsing files in the GUI would be infinitely easier than fiddling with the command line. But this couldn't be further from the truth. Mastering the ls command will allow you to list directory contents and find files a lot more efficiently than any GUI tools. It can also be utilized in Bash scripting to help other tools manipulate files.

In this guide, we'll introduce you to the ls command through various examples and scenarios on a Linux system. By the end, you'll have a good understanding of how it works, and be able to use it for all of your file listing needs. At the end of the guide, we have an exercises section to help make sure you've learned some of the most essential aspects of the command.

In this tutorial you will learn:
  • How to use the ls command with examples
  • Frequently used options with the ls command
  • ls command exercises

Files with the xlsx extension have been formatted for Microsoft Excel. These documents contain columns and rows of data, just like those found in Google Sheets or LibreOffice Calc. This data can be stored as CSV (comma separated values), making it easily readable by various applications or even plain text editors. Due to their proprietary nature, Excel spreadsheets can be difficult to open on Linux systems, making CSV files a much more cross compatible format.

In this guide, we'll show you a few different methods to convert Excel spreadsheets into comma separated files. This can be done from the command line, or you can open the spreadsheets with LibreOffice and resave them in the desired format, as you'll see below.

In this tutorial you will learn:
  • How to convert xlsx files to csv via command line with ssconvert
  • How to convert xlsx files to csv via command line or GUI with LibreOffice

If you have a lot of tab characters inside a text document or program file, they can be annoying because of how they're represented differently in various text editors. For example, when you send your code to someone else, is it going to display the same way on their screen as it did on yours? Tabs are a bit unpredictable in this respect, and spaces are a much safer bet.

In this guide, we'll show how to replace all the tab characters inside a file with spaces on Linux. We can use various Linux commands to do the job for us, which we'll go over below. Depending on your situation and the file in question, some commands may be more suitable than others.

In this tutorial you will learn:
  • How to replace tab characters with spaces

Developers interested in the Android mobile operating system are able to use the Android SDK and various IDE software to code applications. These apps can then be made available and marketed to Android users around the world.

There are a lot of choices when it comes to programming Android applications. Your coding environment can involve a Linux system and a variety of different IDE programs to facilitate all of the software development. The trouble here is that each Linux distribution will often have a different set of requirements to run the sofware, and a separate list of steps that need to be followed.

In this guide, we'll go through the step by step instructions to install Android Studio - which is one of the most popular Android IDEs - on a Linux system. This will work on any distribution because we'll be using Snap package manager to manage the installation. Love it or hate it, the Snap package manager gets your system ready for Android development very quickly, by handling all the dependencies and working identically on any distribution you're running, whether it be Ubuntu, Debian, Red Hat, CentOS, AlmaLinux, openSUSE, or any other type of Linux system.

Follow along with us below as we setup Snap package manager, install Android Studio, and then program a Hello World Android application to verify that everything is working properly.

In this tutorial you will learn:
  • How to setup Snap package manager
  • How to install Android Studio and SDK packages
  • How to create a Hello World test application
  • How to run an Android application on an emulated device

Removing duplicate lines from a text file can be done from the Linux command line. Such a task may be more common and necessary than you think. The most common scenario where this can be helpful is with log files. Oftentimes log files will repeat the same information over and over, which makes the file nearly impossible to sift through, sometimes rendering the logs useless.

In this guide, we'll show various command line examples that you can use to delete duplicate lines from a text file. Try out some of the commands on your own system, and use whichever one is most convenient for your scenario.

In this tutorial you will learn:
  • How to remove duplicate lines from file when sorting
  • How to count the number of duplicate lines in a file
  • How to remove duplicate lines without sorting the file

Visual Studio Code or VSCode is a text editor developed by Microsoft that supports many popular programming languages such as Go, Java, JavaScript, Node.js, Python, C and C++. It is a directory based, language agnostic source code editor which focuses on directories rather than projects and has many extensions available for it. VSCode’s feature set includes bracket matching, syntax highlighting, code folding, linting, debugging, and built in version control via Git, Subversion or Perforce. Ever since the initial release of VSCode in 2015, it has become an increasingly popular programming tool amongst users of all desktop operating systems including GNU/Linux.

One of the many benefits of using Linux over Windows is the fact that the user doesn’t have to send telemetry to Microsoft. Because VSCode is built on open source and the source code is released under the MIT license, it is seen by many in the open software community as a welcome addition. In fact, many in the community who never would have considered installing any other software from Microsoft may be tempted to try out VSCode. Microsoft wants the Linux community to use VSCode. Microsoft even provides easily installed .deb and .rpm packages in addition to a distribution independent snap package. In fact, we previously covered how to install Visual Studio Code on Ubuntu 20.04 desktop using snap. These official binary versions of VSCode have proprietary elements and built in Microsoft telemetry which is enabled by default. According to Microsoft’s privacy statement, this telemetry is also shared with their affiliates and subsidiaries. Although it is possible to disable the telemetry, simply opening the application to do so may send telemetry to Microsoft because it is activated by default. Additionally, the possibility remains that a future update could reactivate the telemetry.

Is there any way to use VSCode without Microsoft’s proprietary elements and telemetry? As it turns out, there are two options. The first option is to build VSCode from the open source MIT licensed source code hosted on GitHub. Historically, when you build VSCode from source the telemetry and proprietary elements that Microsoft adds to the binaries are not included. The second option is to install a pre-built binary provided by the VSCodium project, who essentially build a telemetry free MIT licensed version of VSCode for you. We will explore both options in this article.

In this tutorial you will learn:

  • How to download and build an open source version of VSCode from GitHub and ensure that telemetry is disabled.
  • How to add a VSCodium repository and install an open source telemetry free version of VSCode with your package manager
  • How to directly download, and verify, the latest release of VSCodium.

The Bash shell is the most popular shell on Linux systems, and to use the shell efficiently, you need a little knowledge about Bash shell redirections. This is also an essential step in learning Bash scripting.

In this guide, we'll show how to redirect standard output and standard error to the same file on the Bash shell command line. This will include several examples so you can pick the right method in any scenario.

In this tutorial you will learn:
  • How to redirect standard output and standard error to same file
  • How to redirect standard output and standard error to file and terminal
  • How to redirect standard output and standard error to /dev/null

Environment variables are part of the Linux system shell that contain changing values. They help facilitate scripts and system programs, so that code can accommodate a variety of scenarios. Unlike regular shell variables, environment variables can be accessed system-wide, by any user or process.

Let's look at a very simple example to see how environment variables work and why they exist. There are many system programs and user made scripts that need to access a current user's home directory. This can be done reliably through the HOME environment variable. Therefore, a script that contains the following line can be used by any user on the system and it will generate the same result.

$ echo $SHELL > $HOME/current-shell.log

$ cat $HOME/current-shell.log
/bin/bash

In this guide, we'll show how to list all the environment variables on a Linux system, as well as set new ones. Setting new environment variables can either be done temporarily, or permanently if you need them to survive a reboot. We'll show instructions for both methods below.

In this tutorial you will learn:
  • How to list environment variables on Linux
  • How to set a temporary environment variable on Linux
  • How to set a permanent environment variable on Linux

The Bash shell is the most popular shell on Linux systems, and to use the shell efficiently, you need a little knowledge about Bash shell redirections. This is also an essential step in learning Bash scripting.

In this guide, we'll show how to append text or command output to a file on the Bash shell command line. This will include several examples so you can pick the right method in any scenario.

In this tutorial you will learn:
  • How to append text or command output to a file
  • How to append and view command output at the same time
  • How to append multiple lines of text to a file
Appending text to a file in Bash on Linux
Appending text to a file in Bash on Linux

Wordpress is probably the most used CMS in the world (it is estimated that almost 40% of all websites are built using the platform): it is very easy to install and use, and allows even non-developers to create website in few minutes. Wordpress has a very large plugin ecosystem; one of the most famous is Woocommerce, which allows us to turn a website into an online store in few steps. The plugin makes use of the Wordpress REST API infrastructure; in this tutorial we will see how to interact with the Woocommerce API using the Python programming language, showing how to list, create, update and delete products and categories.

In this tutorial you will learn:

  • How to generate Woocommerce REST API credentials and enable pretty permalinks
  • How to interact with the Woocommerce REST API using Python and the woocommerce package
  • How to get information about the existing Woocommerce categories, create, update and delete them
  • How to get information about the existing Woocommerce products
  • How to create simple and a variable products with variations
  • How to update and delete a product
woocommerce-rest-api

When you develop complex Bash scripts and start putting various scripts into a folder, where one script interacts with another by, for example, starting it, it quickly becomes necessary to ensure we know the path the script was started from, so we can start the other scripts with a fully qualified pathname. This is important because the first script may have been started from outside the script’s directory. We could have also done so by using a relative path, so even - somehow - reading the command that started the current script will not work.

In this tutorial, you will learn:

  • What the pwd command is, and what it does
  • How to discover from inside a Bash script what path that same script is in

How we express a number depends on whether we are a computer or a human. If we are human, we are likely to express numbers using our familiar 10-base decimal system. If we are a computer, we are likely, at our core, to express numbers as 2-base or binary.

So what is up with all the many ways of expressing numbers, and why do they exists? This article will go into some detail and hopefully by the end you’ll be counting octal on your fingers. Which works fine by the way, as long as you use only 8 fingers, after all… octal is 8-base.

In this tutorial you will learn:

  • How to do simple counting in up non-decimal systems like binary, hexadecimal and octal.
  • What the terms 2-base, 10-base etc. stand for and how to understand them more easily.
  • The connection between these various methods of expressing numbers

Bash is a great coding language, which allows you to do complex things like Big Data Manipulation, or simply create sever or desktop management scripts.

The entry level skill required to use the Bash language is quite low, and one-liner scripts (an often used jargon, which indicates multiple commands executed at the command line, forming a mini-script), as well as regular scripts, can grow in complexity (and how well written they are) as the Bash developer learns more.

Learning to use special variables in Bash is one part of this learning curve. Whereas originally the special variables may look cryptic: $$, $?, $*, $0, $1, etc., once you understand them and use them in your own scripts, things will soon become clearer and easier to remember.

In this tutorial you will learn:

  • How to use special variables in Bash
  • How to correctly quote variables, even special ones
  • Examples using special variables from the command line and scripts

On Linux and Unix-based operating systems, pipes are very useful since they are a simple way to achieve IPC (inter-process communication). When we connect two processes in a pipeline, the output of the first one is used as the input of the second one. To build a so called “anonymous” pipe, all we have to do is to use the | operator. Anonymous, or unnamed pipes last just as long as the processes they connect. There is, however, another type of pipe we can use: a FIFO, or named pipe. In this article we will see how named pipes work and in what they are different from the standard pipes.

In this tutorial you will learn:

  • What is a named pipe
  • How to create a named pipe
  • How to recognize a named pipe
  • How named pipes work
  • How to delete a named pipe

If you are just starting to explore the Bash coding language, you will soon find yourself wanting to create conditional statements. Conditional statements, in other words, define ‘if a condition is true or false, then do this or that, and if the opposite is true, do something else’. This is the most basic function of any conditional statement.

This article will introduce you to the five basic if statement clauses. being if, elif, else, then and fi. The first simply opens a if statement, the then introduces the what commands to execute if the statement condition was true section and the else introduces the what commands to execute if the statement condition was false section. Finally, the fi closes the statement. We also have the special elif on which we will see more in a minute. Let’s start with an easy example.

In this tutorial you will learn:

  • How to implement an if statement at the Bash command line
  • How such if statements can also be used inside a Bash scripts
  • Examples showing you the if, elif, else, then and fi clauses in Bash

FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: