Found 1436 Articles for Linux

The head and tail commands in LINUX

Pradeep Jhuriya
Updated on 13-Feb-2023 17:27:34

3K+ Views

Introduction The command line is a powerful tool for managing and manipulating files and directories in Linux. Two essential commands for working with text files are the “head” and “tail” commands. These commands allow users to display the beginning or end of a file, respectively. In this article, we will explore the usage and options of the head and tail commands in Linux. head command The head command is used to view the first few lines of a file. By default, it will display the first 10 lines of a file, but this number can be changed with the ‘-n’ ... Read More

Guide to the Linux touch Command

Pradeep Jhuriya
Updated on 13-Feb-2023 17:25:37

424 Views

Introduction The Linux touch command is a versatile tool that allows you to create new files and update timestamps on existing files. In this guide we will explain the basic use of the touch command and some of its advanced options. We will also provide examples of how to use the command and show the corresponding output. By the end of this guide, you'll have a solid understanding of how to use the touch command to manage files on your Linux system. Basic usage touch command The basic syntax of the touch command is as follows − $ touch [options] ... Read More

Date Command in Linux

Pradeep Jhuriya
Updated on 13-Feb-2023 17:24:39

13K+ Views

Introduction The "date" command in Linux is a simple but powerful tool used to display the current date and time, as well as set the system date and time. This command is extremely useful for troubleshooting and system administration tasks, and is a vital tool in understanding any Linux user. In this article, we'll discuss the basic usage of the date command, as well as some of its more advanced options and features. We'll also cover some examples of how the date command can be used in real-world scenarios. Basic usage of date command The date command is one of ... Read More

“Cut” Command in Linux

Pradeep Jhuriya
Updated on 13-Feb-2023 17:23:27

527 Views

Introduction The "cut" command in Linux is a powerful command line utility that allows you to extract specific sections of text from a file or data stream. Whether you're working with tab-delimited files, CSV files, or just want to extract a specific range of characters, the cut command is a versatile tool that can help you get the job done quickly and easily. In this article, we will discuss the basic usage of the cut command as well as some advanced options and examples of how it can be used. We'll also look at some real-world use cases for the ... Read More

Guide to the sed Stream Editor on Linux

Pradeep Jhuriya
Updated on 13-Feb-2023 17:19:20

661 Views

Introduction Sed, also known as the "stream editor", is a powerful command-line tool on Linux that allows you to perform basic text transformations on an input stream (either a file or input from a pipe). Sed is especially useful for making bulk changes to large numbers of files, or for editing files that are difficult to open with a text editor. This guide will serve as a detailed introduction to sed, including its syntax, basic commands, and examples of how to use sed in different scenarios. We'll also explore advanced features like grouping and in-place editing to help you master ... Read More

Using Shebang #! in Linux Scripts

Pradeep Jhuriya
Updated on 13-Feb-2023 17:17:39

6K+ Views

Introduction On Linux, a shebang (#!) is a special line at the beginning of a script that tells the operating system which interpreter to use when executing the script. This line, also known as a hashbang, shabang or "sharp-exclamation", is the first line of a dash and starts with "#!" followed by the path to the interpreter. The Shebang line is important because it allows you to run scripts written in any language, not just shell scripts, on a Linux system. Understanding Shebang What is a Shebang? The Shebang “#!” The symbol indicates which interpreter, or which version of an ... Read More

The nslookup Command on Linux

Pradeep Jhuriya
Updated on 13-Feb-2023 17:16:30

15K+ Views

Introduction The nslookup command is a tool used to query Domain Name System (DNS) servers and retrieve information about a specific domain or IP address. This command is an essential tool for network administrators and system engineers as it can be used to troubleshoot DNS issues and gather information about DNS configurations. In this article, we'll explore the nslookup command on Linux in depth, including its syntax, options, and examples of how it can be used to troubleshoot DNS issues. We will also discuss the prerequisites for using the nslookup command and how to install it on various Linux distributions. ... Read More

Transfer Files Between Linux Machines Over SSH

Pradeep Jhuriya
Updated on 13-Feb-2023 17:15:39

2K+ Views

Introduction Transferring files between Linux machines over SSH is a common task for system administrators and developers. SSH (Secure Shell) is a protocol that allows you to securely transfer files between machines, as well as remotely access and manage them. In this article, we will explore different ways to transfer files over SSH and demonstrate the process with examples and commands. Setting up SSH Before you can transfer files over SSH, you need to set up SSH on both the source and destination machines. SSH is a secure communication protocol that allows you to remotely access and manage your Linux ... Read More

Linux tar Command

Pradeep Jhuriya
Updated on 07-Nov-2023 04:39:46

65K+ Views

Introduction The tar command in Linux is one of the most essential commands when it comes to file management. It is short for Tape Archive and is used to create and extract archive files. An archive file is a compressed file that contains one or more files bundled together for more accessible storage and portability. In this guide, we'll demonstrate, through examples, how to create, list, edit, and extract tar archive files, and cover some of the more commonly used tar command options. Syntax of the tar command The tar command accepts the following syntax − $ $ tar [options][archive-file] ... Read More

Is There a Way to ‘uniq’ by Column on Linux?

Pradeep Jhuriya
Updated on 13-Feb-2023 17:13:44

2K+ Views

Introduction On the Linux operating system, the "uniq" command is used to remove duplicate lines from a sorted file. However, sometimes you may need to remove duplicates based on a specific column, rather than the entire row. This becomes particularly useful when working with column-based input files, such as CSV files. In this article, we'll explore several ways to do this per-column "uniq'ing" on Linux. Method 1: Use sort command The sort command is a simple and effective way to sort rows by a specific field and remove duplicates from the sort result. For duplicates, only the first instance will ... Read More

Advertisements