Found 796 Questions for Operating System

How to Get the most recent file in a directory in Linux?

Vishesh Kumar
Updated on 21-Nov-2022 10:29:07
We can use a variety of commands to obtain various types of information about files and folders in a directory. In this article, we'll look at commands for finding the most recently updated or modified file in a directory. There are several ways to find out the most recent file in a directory, we’ll explore them in this article. Before moving further let’s set up the environment for the problem. Basic set up First we will create a directory $ mkdir example Navigate into this directory, and create multiple files using touch command cd example/ $ ... Read More

How to Merge PDF Files in Bash?

Vishesh Kumar
Updated on 21-Nov-2022 10:21:51
Introduction On various occasions, we desired to combine PDF files to organise them, lessen clutter, or share them with others. Linux provides a variety of utilities for merging pdf files. Some of the most popular ones are listed below − pdfunite pdftk gs convert qpdf These application tools have a lot of functions, and for this article, we will concentrate on their file-merging functionality. Let's examine some of them individually. pdfunite "pdfunite" is the tool's name in the Poppler Utils package that merges PDF files. The use of pdfunite is rather easy. Use the DNF command below to ... Read More

How to write Stdout to a file with colors?

Vishesh Kumar
Updated on 21-Nov-2022 10:20:02
Introduction The tools we can use to send standard output to files while maintaining their colours will be covered in this post. This is especially helpful while troubleshooting because it makes it simpler to scan the output logs thanks to the coloured areas. By Using Grep A file can be searched for text patterns or strings using the grep command. Regular expressions are the names given to the patterns. Syntax The syntax for the grep command is as follows − $ grep [options] pattern [files] Example Let's make a example.txt file by using cat command. After that we will ... Read More

How to swap two files in Linux command line?

Vishesh Kumar
Updated on 21-Nov-2022 10:17:04
As system administrators or DevOps functions, many times we come with the requirement to exchange files content, for example, suppose you have a backup file of /etc/passwd by name /etc/password.backup and you want to restore the same in /etc/passwd but you also want current content of /etc/password should be copied to /etc/passwd.backup. In other words, exchange content of /etc/passwd with /etc/passwd.backup and /etc/passwd.backup with /etc/passwd. The Linux operating system's useful tools and commands enable you to achieve/accomplish a wide range of file manipulation goals. For one reason or another, you may need to swap two files in the Linux ... Read More

How to encrypt a large file using openssl?

Vishesh Kumar
Updated on 21-Nov-2022 10:15:16
OpenSSL OpenSSL is a valuable tool for general-purpose cryptography and secure communication, and it does various tasks, including encrypting files. Most Linux distributions install the device by default; if not, you can install it using your package manager. Before encrypting a file using OpenSSL, let us have a basic understanding of encryption. Encryption is a method of encoding a message to protect its contents from prying eyes. There are two types in general − Symmetric or secret-key encryption Asymmetric or public-key encryption Secret-key encryption uses the same key for encryption and decryption, whereas publickey encryption uses separate keys ... Read More

How to Add a String After Each Line in a File in Linux?

Vishesh Kumar
Updated on 21-Nov-2022 10:08:33
Introduction We occasionally need to make changes to files quickly, preferably from the command line. One example is adding a string to the end of each line of a file. In this article, we'll look at several ways to accomplish this using various Linux commands. The sample file language.txt that follows will be used throughout this article − pi@TTP:~ $ touch language.txt Example A file will be created with the name of language.txt. pi@TTP:~ $ cat > language.txt With the help of cat command with > we can insert data into the file. If we open the file language.txt you ... Read More

How to Find Open Port in Linux?

Vishesh Kumar
Updated on 21-Nov-2022 09:54:12
Before explaining how to list all open network ports in Linux, we will briefly discuss ports in computer networking. In computer networking and software terms, a port is a logical entity representing a network application. A port is a term used to recognize a network service by a number. The port serves as a communication endpoint for the Linux operating system to identify a specific process or application. A port is a 16-bit (0 to 65535) number that distinguishes one running network application from others. We can classify these port numbers into three categories, Well-Known Ports (0 to 1023) ... Read More

Docker Container Network Namespace Is Invisible

Vishesh Kumar
Updated on 21-Nov-2022 09:50:49
This article will look at a problem with the network namespace file in a Docker container. We'll examine why the network namespace file is invisible to the ip netns ls command. Before moving ahead, let's have a brief overview of Docker, Containers and Network Namespace Containerization Containerization is similar to virtualization, in which an application and all its dependencies and libraries are packaged into a single container; it can run in any computing environment. When the OS kernel and all necessary libraries and dependencies are included in the container, anyone working on the application can use only the container to ... Read More

cURL Command Without Using Cache

Vishesh Kumar
Updated on 21-Nov-2022 09:45:02
Introduction cURL (Client URL) is a command-line tool. It allows data to be transferred to or from a server without requiring user interaction by utilising the supported libcurl library. cURL can also be used to troubleshoot network connections. In some cases, we may need to send requests that bypass the cache and generate a new response from the server. Caching can occur on the client side (browser cache) or the server side. When using the cURL command, remember that it is only an HTTP client and does not cache any requests on the client side. As a result, any caching ... Read More

Creating a Hex Dump of a File

Vishesh Kumar
Updated on 21-Nov-2022 09:42:30
Introduction Hexdump shows the binary file contents in hexadecimal, decimal, octal, or ASCII form. It is an inspection tool that is also useful for programming, reverse engineering, and data recovery. It represents the content of a file in hexadecimal form. The various tools we can use to generate a file's hex dump will be covered in this article. We will learn to create a hex dump of a file. To utilise as a model for this article, let's generate an ASCII text file. $ cat >> example.txt This is our sample text in the file. We will convert it ... Read More
1 2 3 4 5 6 7 ... 80 Next