In this tutorial, we’ll check some ways to build a complete Linux path by concatenating two strings holding the subpaths.
Also find me here:
Baeldung Editor
Bruno Fontana
Bruno has been a Software Engineer for more than 15 years and a techie since he was a kid. He has worked on several projects in different industries. Nowadays he is working as an Application Architect in the payments industry. When he is not developing or architecting you will find him doing 3D modeling, a bit of carpentry, or taking long walks around the city.
Here's what I've reviewed (so far):
Baeldung on Linux
- All
- Scripting (16)
- Files (7)
- Administration (4)
- Processes (3)
- Networking (2)
- Filesystems (1)
- File Searching (1)
- Docker (1)
Why Do We Use ./ (Dot Slash) To Execute a File in Linux
Filed under Files
In this tutorial, we’ll learn when and how to use “./” for running a script in Linux.
Get Exit Code of a Background Process
Filed under Scripting
Let’s discuss how we can get the exit code of a process running in the background.
The “Argument List Too Long” Error in Linux Commands
Filed under Files
Understand what causes the “argument list too long” problem in Linux and how to solve it.
Difference between ${} and $() in Bash
Filed under Scripting
In this tutorial, we’ll discuss the differences between ${} and $() in Bash.
Bash Script to Calculate Time Elapsed
Filed under Scripting
In this tutorial, let’s explore how to measure elapsed time of a script in Linux.
List the Size of Each File and Directory, and Sort by Size in Linux
Filed under File Searching
As Linux users, we frequently interact with the file systems. One of the common tasks is to list the files and sort them according to their size.
SIGINT And Other Termination Signals in Linux
Filed under Processes
In Linux systems, processes can receive a variety of termination signals, such as SIGINT or SIGKILL. Let’s explore them.
Iterate Over a List of Files With Spaces in Their Names in Linux
Let’s explore how we can iterate over a list of files with spaces in their names.
How to Insert a New Line Character in Linux Shell Script Output
Filed under Scripting
In many cases, we need to add a new line in a sentence to format our output. In this tutorial, we’ll explore some Linux commands for such a task.
Bash HISTSIZE vs. HISTFILESIZE
Filed under Administration
In this tutorial, we’ll look at the meaning of the Bash HISTFILESIZE and HISTSIZE variables.
How to Calculate Optimal Blocksize to Use With dd
Filed under Filesystems
When using dd, setting the optimal block size can greatly improve performance. In this tutorial, we’ll see how we can obtain a device’s blocksize.
How to Delete the History of the Last n Commands?
Filed under Administration
When working with the command-line under Linux, recent commands will be kept inside history. In this tutorial, we’ll see how we can delete the last n entries from that history.
Storing a Command in a Variable in a Shell Script
Filed under Scripting
In this article, we’ll see how we can store a command into a variable and run it. We’ll also discuss what limitations these methods have and the problems we face.
When to Use an Alias vs Script vs a New Function in Bash
Filed under Scripting
In this tutorial, we’ll discuss when it’ll be better to define aliases, to use Bash functions, or to create a new shell script.
Linux Interview Questions
Filed under Administration
Let’s review some of the questions about Linux and Shell Scripting that are often asked in technical interviews.
Redirecting the Output of an Already Running Process
Filed under Processes
Let’s learn different ways to redirect or copy the output of an already running process
Preserve Bash History in Multiple Terminal Windows
Filed under Administration
In this tutorial, we’ll look at ways to preserve Bash history in multiple terminal windows.
Calculate an MD5 Checksum of a Directory in Linux
Filed under Files
In this tutorial, we’re going to learn how to calculate a single MD5 checksum of an entire directory tree in Linux.
Running Multi-Line Shell Code at Once From Single Prompt
Filed under Scripting
There are many ways to run multi-line shell commands in Linux at once. Let’s explore and compare them.
Get the Contents of a Web Page in a Shell Variable
Filed under Scripting
Sometime we may need to process the content of a web page in our scripts. Let’s see how we can download a web page to a shell variable for further processing.
Move All Files Including Hidden Files Into Parent Directory
Filed under Files
Let’s see some ways to move all files, including hidden ones, to the parent folder.
How To Script “Yes” When Installing Programs
Filed under Scripting
Let’s see how we can automatically answer yes in our scripts.
The Uses of the Exec Command in Shell Script
Filed under Scripting
The Bash built-in command ‘exec’ is a powerful tool. Let’s find out what it can do for our scripts.
Difference Between grep, sed, and awk
Filed under Scripting
Let’s look at the differences between grep, sed, and awk.
How to Use the Paste Command
Filed under Scripting
The paste command is a simple yet powerful tool. Let’s explore how we can use it.
What Is the LD_PRELOAD Trick?
Filed under Processes
Are you curious about what the “LD_PRELOAD trick” is and what you can use it for? Just keep reading.
Recursively List All Files in a Directory Including Symlinks
Filed under Files
Do we need to recursively list directories that contain symlinks? Let’s find out how in this tutorial.
What Does a Double-Dash in Shell Commands Mean?
Filed under Scripting
Certain characters cause problems when we use them in command arguments. Let's see how double-dash could be the solution.
Generating an SHA-256 Hash From the Command Line
Filed under Files
When we need to generate file hashes, SHA-256 is often one of the best choices. Let’s see how this works in Linux using the command line.
Connecting from Docker Containers to Resources in the Host
Filed under Docker, Networking
We often need to connect from our Docker containers to applications in the host. This is not the default, so let’s see what we need to do to make it possible.
Obtaining an SSL Certificate from the Server
Filed under Networking
Sometimes, we need to retrieve the SSL certificate from a server for further processing. Let’s see how we can do this in Linux.
When to Use xargs
Filed under Scripting
xargs
is very useful when we need to build command pipelines that pass the output of one command, as arguments for another.