Linux Articles

Page 55 of 134

How to set the GOPATH environment variable on Ubuntu?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 9K+ Views

Before setting up GOPATH or GOROOT on your local environment, we must verify that Go is correctly installed on your system. Type the following command in your terminal to check the Go installation − go version If it outputs nothing or displays "go: command not found", then you need to first download the Go binary and install it before setting up the GOPATH. When Go is properly installed, the output will look something like this − immukul@192 linux-questions-code % go version go version go1.16.3 darwin/amd64 Understanding GOPATH GOPATH is ...

Read More

How to show all shared libraries used by executables in Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 2K+ Views

We know that a shared library is a library that can be linked to any program at runtime. In order to view all the shared libraries used by an executable we make use of the Linux command utility known as ldd. We can easily locate the shared libraries on a Linux machine, as they usually start with lib* prefix and have extensions like .so (shared object). Let's first understand and see examples of how to make use of the ldd command that Linux provides us with. ldd is a command utility that Linux provides us with and is ...

Read More

How to simulate delayed and dropped packets on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 762 Views

Network emulation (netem) is a Linux kernel component that provides network emulation functionality for testing protocols by simulating real-world network conditions like delays, packet loss, and reordering. It emulates the properties of wide area networks, making it invaluable for network testing and protocol development. The current stable version of netem allows emulation of variable delay, packet loss, packet reordering, and packet duplication. This makes it possible to test how applications and protocols behave under various network conditions without requiring actual network infrastructure. Enabling netem There are two ways to use the network emulator. First, you can enable ...

Read More

How to sort a file in-place in Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 1K+ Views

In Linux, the sort command is a powerful utility for arranging file contents in a specific order. By default, it sorts lines alphabetically based on ASCII values. However, the basic sort command only displays sorted output without modifying the original file. To sort a file in-place (modifying the original file), we need specific techniques. Understanding the Sort Command The sort command operates line by line, treating each line as a record. Key characteristics include − Sorts one line at a time from the input Displays file contents similar to the cat command when applied to files ...

Read More

How to substitute an environment variable using sed on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 3K+ Views

Environment variables are dynamic named values that store system configuration and user-defined settings. They can be exported in a terminal session or stored in shell configuration files for persistent access across all terminals. The sed (stream editor) command provides a powerful way to modify environment variable values within files programmatically. Understanding sed Command The sed command is a stream editor used to perform various text manipulation operations like find, replace, insert, and delete on files or input streams. It processes text line by line and applies specified transformations. Syntax sed [OPTIONS]... [SCRIPT] [INPUTFILE...] ...

Read More

How to suppress a binary file matching results in grep on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 918 Views

The grep command in Linux is used to filter searches in files for particular patterns of characters. It displays lines that contain the pattern we are searching for, where the pattern is referred to as a regular expression. When searching through directories containing both text and binary files, grep may attempt to process binary files, which can produce unwanted output or warnings. This article explains how to suppress binary file matching results. Basic grep Syntax grep [options] pattern [files] Common grep Options -c : Count of lines that match the pattern -h ...

Read More

How to test a weekly crontab job on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 1K+ Views

In order to test a crontab job we first need to explore and understand what a crontab job is. A crontab job is nothing but a list of commands that we can run during a cron job. A cron job is a utility that schedules automatic execution of commands at specific times. We can start a cron job with the help of bash script by following the commands shown below − crontab -e This will open a file which you can edit, insert the cron job shell script in the above file and then ...

Read More

How to unzip all zipped files in a Linux directory?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 3K+ Views

The unzip command is a Linux utility used to extract compressed files from ZIP archives. When working with multiple ZIP files in a directory, you can extract them all at once using wildcard patterns and command-line options. Installing Unzip By default, the unzip utility is not present on most Linux distributions. You can install it using the package manager for your distribution. For Ubuntu and Debian sudo apt install unzip For CentOS and Fedora sudo yum install unzip Basic Syntax unzip file.zip In the above ...

Read More

How to use a pipe with Linux find command?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 3K+ Views

Linux find command is one of the most widely used commands that allows us to walk a file hierarchy. It is used to locate specific files or directories, and we can combine it with other Linux commands using pipes to perform complex operations. Basic Find Command Let's explore a simple example of the find command to understand it better. find sample.sh sample.sh If the find command locates the file, it prints the filename. If not found, it returns nothing and the terminal process terminates. Understanding Pipes in Linux A ...

Read More

How to use chmod recursively on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 503 Views

chmod is a Linux command that changes file and directory permissions. When working with complex directory structures, you often need to modify permissions not just for a single file, but for all files and subdirectories within a directory tree. This is where the recursive option (-R) becomes essential. In Linux, file permissions control who can read, write, or execute files and directories. The chmod command allows you to modify these permissions using either symbolic notation (like rwx) or numeric notation (like 755). Basic chmod Syntax chmod [OPTIONS] MODE file... chmod [OPTIONS] NUMERIC_MODE file... chmod [OPTIONS] --reference=RFILE ...

Read More
Showing 541–550 of 1,338 articles
« Prev 1 53 54 55 56 57 134 Next »
Advertisements