Found 1436 Articles for Linux

Print Lines Between Two Patterns in Linux

Prateek Jangid
Updated on 18-May-2023 16:18:17

2K+ Views

Printing lines between two patterns is functional when you need to print only a few lines from these files or keep your lines under a specific pattern. Although you can print the lines through the grep command, it is impossible to print the particular line. In this case, you can use commands like sed or awk to print lines between two patterns. So In this article, we will elaborate on various examples to print lines between two patterns in Linux. We will also include multiple conditions for using the sed and awk command to print lines between patterns. Printing Lines ... Read More

List the Size of Each File and Directory and Sort by Size in Linux

Prateek Jangid
Updated on 22-Aug-2023 12:39:00

1K+ Views

Listing the size of each file and directory is good because it helps a user sort them according to the size. Sorting files according to size is necessary to free up space, make them more organized, etc. You can organize the Linux file system through the command line and graphical methods. It helps you to quickly locate the files and directories as per their contents available. So in this long guide, we will explain various ways to easily List each directory and sort them according to the size in Linux. List the Size of Each File and Directory and Sort ... Read More

How To List All Group in Linux ?

Prateek Jangid
Updated on 18-May-2023 16:28:18

726 Views

Groups in Linux are the collection of all the users of a system. These groups offer a convenient and simple way for the system users to share the directories with no issues. A Linux system can have many users who are divided into several groups. Admin must rank each member of these groups to assign the resource-driven permissions privileges. Users can mainly belong to two types of groups − Primary / Login Group Secondary / Supplementary Group User-created files are assigned to this group. The primary group usually has the same name as a user's name. ... Read More

How to Insert a New Line Character in Linux Shell Script Output ?

Prateek Jangid
Updated on 18-May-2023 14:40:34

576 Views

In bash, a newline refers to a line's end and a text's beginning. In Linux/Unix operating systems, the new line character is represented as ", " which instructs the terminal to move the cursor to the beginning of the next line. Many text editors don't show it by default. Inserting a new line character has several important reasons − It helps format the output to be understood and readable. Separating the output into sections makes it easier to locate specific information. The newline is also used as a line break that identifies the end of a line in a ... Read More

How to Create Soft Links to Directories on Linux?

Prateek Jangid
Updated on 22-Aug-2023 12:36:33

2K+ Views

A soft link (symlink or symbolic link) is generated as a shortcut to the available files or folders in the system. Usually, these soft links are used to link libraries. Soft links allow storing multiple clones of the same document in different file systems or destinations. This link refers to the path and address of the original document. The soft link contains different aspects, such as − Soft links can link to both directories and regular files. After deleting the soft link, the original document remains available. The symbolic link does not work when you move or delete the ... Read More

Find the Total Size of All Files in a Directory on Linux

Prateek Jangid
Updated on 22-Aug-2023 12:33:27

3K+ Views

You can use various types of commands to get the total size of all files in a directory on Linux. There are also some GUI tools in Linux to display the total size of the directory in a more simple format. Getting the correct information about the directories can help a user to find the storage allocation of the complete system. That's why Linux users always look for ways to find the total size of the directory. In this guide, we will explain various methods to find the total size of all files in the directory on Linux. Finding the ... Read More

Find Files Not Owned by a Specific User in Linux

Prateek Jangid
Updated on 18-May-2023 14:36:13

580 Views

A Linux system may consist of various users with different permissions. However, sometimes we need to find and access a specific user's files. So, in this case, you can use the find command to display the files owned by any other user. The find commands let you search for a specific file in the directory. With this command, you can find the list of available files per the owner, type, and attributes, like a file name. The find command utility is pre-installed in almost every Linux distro. So if you also want to find the file which a specific user ... Read More

File Editing: Appending a Non-Existent Line to a File

Prateek Jangid
Updated on 18-May-2023 14:34:03

45 Views

Appending a line or string to a file is sometimes necessary to change the output without deleting the existing data. It is a valuable way to modify a file by adding several lines between the existing ones of a file. "append" means adding the data into a file without erasing currently available data. To append a line in the file, you can use various commands such as printf, echo, tee, cat, etc. Although appending a line is easy, many beginners always require clarification. So this tutorial will include the simple approaches for appending a non-existent line to a file. File ... Read More

Enable Debugging Mode in SSH to Troubleshoot Connectivity Issues

Prateek Jangid
Updated on 18-May-2023 14:24:58

2K+ Views

Sometimes, You need to connect your system on two different remote servers. In this condition, you can remove and troubleshoot connectivity issues by enabling debugging or verbose mode of these servers using the SSH command. By enabling the debugging mode in SSH, you can see the detailed information related to the SSH connection. You can also check the exchanged data between client and server. Using the -v option, you can run SSH in verbose mode. Running SSH in verbose mode prints debugging information about progress for authentication, debugging connections, or any configuration problems encountered. In this guide, we will explain ... Read More

ELK Stack Tutorial: Get Started with Elasticsearch, Logstash, Kibana, & Beats

Prateek Jangid
Updated on 18-May-2023 14:19:09

928 Views

ELK Stack is one of the best tools to view and handle files in the ELK Stack or the Elastic Stack. This tool consists of E- Elasticsearch, L- Logstash, and K- Kibana, the three open-source tools. ELK Stack tools are used to process and analyze large amounts of data in real time. However, Beats is an open and independent platform for single-purpose data shippers. It sends data from hundreds or thousands of systems and machines to Elasticsearch or Logstash. ELK Stack is widely used in various industries, such as healthcare, finance, and IT, for troubleshooting, monitoring, and log analysis. So ... Read More

Advertisements