Linux Articles

Page 112 of 134

How to Create a New Ext4 File System in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 6K+ Views

Creating a new Ext4 file system in Linux involves formatting a partition with the Ext4 file system type. This is essential when adding new storage or repurposing existing partitions. In this tutorial, we'll explore how to identify available file systems, examine current partitions, and format a partition with Ext4. Available Filesystem Types First, let's check what file system tools are available on your system. The following command lists all the file system creation utilities ? $ ls -1 /sbin/mkfs* /sbin/mkfs /sbin/mkfs.bfs /sbin/mkfs.cramfs /sbin/mkfs.ext2 /sbin/mkfs.ext3 /sbin/mkfs.ext4 /sbin/mkfs.ext4dev /sbin/mkfs.fat /sbin/mkfs.minix /sbin/mkfs.msdos /sbin/mkfs.ntfs /sbin/mkfs.vfat ...

Read More

How to Change or Set System Locales in Linux

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 3K+ Views

We often need to customise the operating system to match our preferences like the language we want to use, the time zone we are in, or the type of currency which would become the default in the OS. In this article we will see how to customise these options which is known as locale. Checking Current Locale We can check the current locale by using the locale command as shown below. We get a list of variables which can be reset to different values as per our choice ? $ locale Running the above ...

Read More

Display Command Output or File Contents in Column Format in Linux

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 769 Views

When working with files containing multiple columns, data can appear cramped and difficult to read. The column command in Linux helps format text into readable columns with proper spacing and alignment, making data analysis much easier. Sample File Let's examine a sample CSV file with iris dataset that we'll use to demonstrate the column command ? $ cat iris.data The output shows cramped CSV data ? Id, SepalLengthCm, SepalWidthCm, PetalLengthCm, PetalWidthCm, Species 1, 5.1, 3.5, 1.4, 0.2, Iris-setosa 2, 4.9, 3.0, 1.4, 0.2, Iris-setosa 3, 4.7, 3.2, 1.3, 0.2, Iris-setosa 4, 4.6, ...

Read More

Why should eval be avoided in Bash, and what should I use instead?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 2K+ Views

eval is a built-in Bash command that concatenates its arguments into a single string, joins them with spaces, then executes that string as a bash command. While powerful, eval poses serious security risks and should generally be avoided. How eval Works Let's see a basic example of eval in action − $ var="echo hello" $ echo $var $ eval $var Running the above code gives us the following result − echo hello hello When eval is applied, the variable expands and gets executed as a command, no longer behaving as ...

Read More

What are the calling conventions for UNIX & Linux system calls on i386 and x86-64

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 924 Views

A system call is the fundamental interface between an application and the Linux kernel. When a Unix/Linux program does file I/O, network data transfer, or invokes processes that interact with low-level instructions, system calls are involved. Making these calls usually involves using a library called glibc which contains the functions. Common System Calls Below is a list of some frequently used system calls and their purpose ? Sr.No ...

Read More

Looping through the content of a file in Bash

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 7K+ Views

Reading file contents line by line is a common requirement in Bash scripting. There are several approaches to accomplish this task, each with its own advantages depending on your specific needs. Creating a Sample File First, let's create a sample file to work with ? # Create the file cat > a_file.txt

Read More

How to convert DOS/Windows newline (CRLF) to Unix newline (LF) in a Bash script?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 2K+ Views

When transferring files between Windows and Unix systems, you'll often encounter issues with end-of-line characters. Windows uses CRLF (Carriage Return + Line Feed) while Unix uses LF (Line Feed) only. This guide shows three methods to convert Windows line endings to Unix format using Bash. Understanding the Problem Windows files use \r (CRLF) for line endings, while Unix systems use (LF). When viewing Windows files on Unix, you may see ^M characters at the end of each line. Method 1: Using dos2unix The dos2unix command is specifically designed for this conversion and comes pre-installed on ...

Read More

Linux WC Command Examples to Count Number of Lines, Words, Characters

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 550 Views

The wc command (word count) is a fundamental Linux utility for counting lines, words, characters, and bytes in files. It's commonly used with the -l option for line counting, but offers several other counting options through various arguments. Available Options Option Command Function 1 wc -c Display number of bytes 2 wc -m Display number of characters 3 wc -w Display number of words 4 wc -l Display number of lines 5 wc -L Display length of longest line ...

Read More

How to Search and Remove Directories Recursively on Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 575 Views

Removing directories is a regular process for anyone working on Unix systems. But sometimes we also need to find the directories first and then decide to delete them. One hurdle in deleting directories is doing recursive deletion because by default Unix systems do not allow deleting of a directory if it is not empty. In this article we will see how to find and remove directories recursively using two effective methods. Using find and exec The find command with -exec searches for directories and executes the removal command directly. This method is efficient for finding and deleting directories ...

Read More

How to Re-run Last Executed Commands in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 358 Views

Re-running commands in the Linux terminal is a common task that saves time and effort. Linux provides several built-in methods to execute previously run commands without retyping them. Understanding these shortcuts improves productivity when working with the command line. Viewing Command History Before re-executing commands, you can view your command history using the history command. This displays all previously executed commands with line numbers ? history The output shows numbered commands from your session history ? 1 perl -v 2 sudo apt update 3 cal 4 ls -l 5 curl -s https://ipvigilante.com/122.175.62.177 ...

Read More
Showing 1111–1120 of 1,338 articles
« Prev 1 110 111 112 113 114 134 Next »
Advertisements