Prateek Jangid

Prateek Jangid

165 Articles Published

Articles by Prateek Jangid

Page 2 of 17

Using grep on Files That Match Specific Criteria

Prateek Jangid
Prateek Jangid
Updated on 18-May-2023 1K+ Views

Grep (global regular expression print) command matches and searches the specific pattern in the regular expressions. This command filters and searches for a particular pattern of characters and displays them as output. It is considered one of the most useful commands on Unix / Linux-like systems for sysadmins and developers. Linux contains various types of commands and utilities to simplify every task. Unlike other operating systems, finding any file in Linux is simple because you can use the grep command to search any file. You can use the grep command to display the specific file's name that contains a particular ...

Read More

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

Prateek Jangid
Prateek Jangid
Updated on 18-May-2023 1K+ 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

Find Files Not Owned by a Specific User in Linux

Prateek Jangid
Prateek Jangid
Updated on 18-May-2023 2K+ 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
Prateek Jangid
Updated on 18-May-2023 212 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
Prateek Jangid
Updated on 18-May-2023 3K+ 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
Prateek Jangid
Updated on 18-May-2023 2K+ 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

Elementary OS – A Linux Distro for Windows and macOS Users

Prateek Jangid
Prateek Jangid
Updated on 18-May-2023 2K+ Views

Elementary OS, a Ubuntu-based Linux OS, offers a stable, fast, and beautiful experience. Linux is always confusing for Windows and macOS users due to various reasons, some of which are as follows − Windows and macOS have a more standardized GUI (Graphical User Interface) quite different from the Linux user interface. So it is difficult for the users to find the correct tools for their requirements The command line interface of Linux is quite different from that of Windows and macOS. That's why users are not able to use it widely. Sometimes Linux only supports less popular or newer ...

Read More

Changing the Default Shell in Linux

Prateek Jangid
Prateek Jangid
Updated on 18-May-2023 2K+ Views

Changing the default shell in Linux is simple, it gives you the freedom to use any shell accordingly. The default shell of most Linux systems is 'bash, ' which you replace from any other shell such as sh, fish, dash, zsh, etc. There can be many reasons in Linux why you need to change your default shell; some of the main reasons are as follows − To disable or block normal user logins using a nologin shell. Change the default shell on a shared network to meet the user's specific demands. It is associated with many administrative rights. A ...

Read More

C++ program to Reorder the Given String to Form a K-Concatenated String

Prateek Jangid
Prateek Jangid
Updated on 10-Aug-2022 191 Views

We are given a string and an integer k, and we need to reorder the characters in the string so that it becomes the concatenation of k similar substring. If not possible, output the result as "Impossible”. string = "malaalam"; K = 2; res = solve(s, K); Example (Using Maps) Let's have a string "mottom" and K=2. The given string can be represented as the concatenation of 2 substrings like tomtom, motmot omtomt, etc. As in all 3, two substrings are joined together when k = 2. Using the string, we can determine how many times each character occurs. ...

Read More

C++ program to Replace Duplicates with Greater than Previous Duplicate Value

Prateek Jangid
Prateek Jangid
Updated on 10-Aug-2022 369 Views

A series of integers is given in this article. Let's say we have an array of four elements without counting the repetitive elements, [2, 2, 5, 5, 7, 8, 7], and we have to make the array distinctive. Changing a value with one that is greater than the previous one is possible. In the above array, element 2 at index 1 becomes 3 as the next greater element. 5 at index 3 becomes 6 as the next greater and so on. So, in the end, our array becomes [2 3 5 6 7 8 9] and should minimize the sum ...

Read More
Showing 11–20 of 165 articles
« Prev 1 2 3 4 5 17 Next »
Advertisements