The uname command in Linux is one of the frequently used commands. On Linux systems, there are a multitude of commands that can be used to print system information. We cover many of these commands in our guide about getting to know the hardware of your Linux box. One such command would be uname, which is especially good for listing information about the operating system itself and the Linux kernel that is running.
bash
Bash script: Shebang usage and best practices
If you have looked at some of our Bash script examples across our website, or seen some others online to learn from, you may have noticed that all of the Bash scripts begin with a shebang.
Removing duplicate lines from a text file using Linux command line
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
Curl command not found
If you encounter the curl command not found on a Linux system, it means that the tool has not yet been installed. The curl Linux command can use various network protocols to download and upload data on Linux. In this tutorial, you will see how to install the curl command on all major Linux distributions.
Bash Scripting Tutorial: How to Write a Bash Script
The Bash shell is one of the most powerful components of a Linux system, as well as one of the most compelling reasons to use Linux. Users can interact with Bash through the command line, and write scripts to automate tasks. Although this may sound intimidating to beginning users, it is not hard to get started with Bash scripting.
Random Entropy in Bash
When using random numbers in Bash, the question of random entropy will sooner or later come up. This article will help you understand what entropy is, how it can be modified and optimized in Bash, and how it will affect random number generation.
In this tutorial you will learn:
- How to generate random entropy in Bash
- How to pre-seed the random number generator in Bash
- Examples demonstrating random entropy generation in Bash
Stat command: Usage and examples
The stat Linux command is one of the best ways to view the full details of any file that is stored on a Linux system. It is installed by default on all distributions, so there is nothing extra to install, and is basically a one stop shop for viewing file permissions, timestamp info like access times and modification times, and various other metadata for any file on your system. It also comes with a few handy options, allowing us to tailor the output for specific needs, and view information about all file types, including symbolic links, pseudo files, and others.
How to install the Zed code editor on Linux
Zed is a high-performance, “multiplayer”, free and open source code editor written in Rust and developed in the open on GitHub. It was created by the same authors as the Atom text editor, and although it has IDE features, it is very responsive. In this tutorial, we learn how to install Zed on some of the most used Linux distributions.
How to write and perform Ubuntu unattended installations with autoinstall
Being able to provision and create replicable installations of an operating system is crucial, especially in corporate environments. To perform unattended installations, Ubuntu used to support Debian preseed and Kickstart files. Starting with Ubuntu server 20.04, and version 23.04 of the Ubuntu desktop, those installation methods became deprecated, and the distribution adopted a new autoinstall format, which takes advantage of cloud-init.
Clean up filenames with detox command line utility
If you have spent much time on the command line to work with files in Linux, then you probably know about the pains of dealing with file names that contain spaces or any other strange characters. It can be tedious to escape certain file names or to work with a bunch of files that have inconsistent encoding in their file names. The detox command is a solution to this problem, as it converts all file names to a consistent format that make them easier to work with.
yes command in Linux with examples
The yes command in Linux will automatically output a “y” or any string you specify, repeatedly. It’s one of the simplest commands on Linux, and one that most users will find they never have much use for. But then when you do need it, you’ll be thankful that your Linux system already includes this Linux command by default.
Calculate column average using bash shell
The purpose of this tutorial is to show how the Bash shell can calcuate the average value of a single column of a text file on a Linux system.