Found 924 Articles for Open Source

Copying SSH Keys to different Linux Machine

Satish Kumar
Updated on 23-Dec-2022 11:03:39
Overview When working with SSH keys, it is important to keep them safe. We can protect ourselves against accidental deletion by storing them in an encrypted file. We can also make sure they aren’t compromised if someone tries to steal them by keeping them offline. For example, we could store them in a password protected folder on a USB drive. However, this isn’t the best way to do things. If you have multiple machines and want to copy your key from one machine to another, then there are better ways of doing that than copying the key files over. This ... Read More

Most Common Flags Used in /proc/cpuinfo

Satish Kumar
Updated on 23-Dec-2022 10:38:52
Overview We’ll go through some of the features available on the CPU installed on our computer’s motherboard. We’ll briefly look at the concept of virtual file systems before we dive into the details of the topic. Afterward, we’ll discuss the flags obtained from the /proc/cpuinfo virtual directory for different CPU manufacturers such Intel, AMD, and Arm. Virtual Files A virtual file system (VFS) is an abstraction layer that allows us to treat files as if they were stored on a disk drive. The VFS provides a way to access data without having to know where it actually resides. For example, ... Read More

What Is Double Dot (..) And Single Dot (.) In Linux?

Kunal Verma
Updated on 19-Dec-2022 12:30:22
Abstract Linux terminal/Shell contains several instances where a dot (.) is utilized. When displayed in the output of a command, a dot would also convey some significance. This article will examine the various situations in which a dot is typically used in Linux and the additional locations where this might be shown. Double Dot (..) and Single Dot (.) Example $ ls -laxo Output Total 892 drwxr-xr-x 122 tutorial article 48 18 Dec 05:07 ./ drwxr-xr-x 54 tutorial article 4096 16 Dec 04:03 ../ -rw-rw-rw- 19 tutorial article 960 02 Dec 09:57 operations In the following example, we ... Read More

Running a Shell Script on a Remote Machine Through SSH

Kunal Verma
Updated on 19-Dec-2022 12:29:01
Abstract It's challenging to envision what would happen if you couldn't control your computer remotely because remote access to computers has long been necessary. The best way to connect to a remote machine is by SSH for Linux-based machines. The SSH client application can be used to log into a distant computer or server and run commands on that computer. When a command is supplied, it is executed instead of a login shell on the remote host or server. Users frequently need to work with distant systems. which requires them to log into the remote server, carry out specific actions, ... Read More

How to check if a File Type Exists in a Directory?

Kunal Verma
Updated on 19-Dec-2022 12:27:11
Abstract There are times when we need to determine whether a particular file type is present in a directory or not. For instance, we might want to check if a directory contains python files. Therefore, there are a few approaches such as ls, find, etc which we can use to determine whether there are python files in the directory. In this tutorial, we will review several approaches to check whether particular file types exist in a directory or not. ls command One of the most used commands in Linux is called "ls". It is used to display a list of ... Read More

Diff a Directory for Only Files of a Specific Type on Linux

Kunal Verma
Updated on 19-Dec-2022 12:25:45
In this article, we are going to learn how to Diff a directory for only files of a specific type in Linux. Abstract In Linux, a frequently used operation is used for comparing files and identifying their differences. It is very helpful while comparing complicated code or in the configuration of files. Linux has a powerful built-in tool called diff that is used to compare directories It is error-free and also saves time. Here are a few examples that will help us learn how to apply these intriguing and adaptable commands, Diff command Using the Diff command, we can compare ... Read More

Get the Full Path of a File in Linux

Kunal Verma
Updated on 19-Dec-2022 12:24:00
Abstract Every file and folder in Linux has a path that directs the user to it. This path is required for programs and scripts to locate and access files. There are various ways to locate the path to a file or folder if you need to. We can get a full file path with different commands on a Linux machine. In other words, if its arguments were supplied, this command would return the pathnames of the files that would be run in the current context. In this tutorial, we'll show you how to obtain a file's complete path in Linux. ... Read More

How to read a Specific Line From a File in Linux?

Satish Kumar
Updated on 01-Dec-2022 09:14:25
When working with the Linux shell, reading text files is often an important operation. Sometimes, we may be interested in reading a specific line from a file. We’ll take a look at different ways to get a specific piece of text out of a file. The actual Problem Let’s take a look at an example. let's say we have a file called "test.txt" − $ nl test.txt 1 This is line 1, I don't have any interesting data. 2 This is line 2, I don't have any interesting data. 3 This is line 3, I don't have any interesting data. ... Read More

How to find total physical memory (RAM) size on Linux?

Satish Kumar
Updated on 01-Dec-2022 09:03:16
We can often get away without checking for total memory usage on servers running Linux. However, sometimes we may want to know the total memory available on our servers. Luckily, there are various ways to accomplish this task. In this tutorial, I’ll show you some of them. Using free Command free is the simplest among the various commands we'll encounter. It's used to display the current amount of physical and virtual RAM (RAM) being utilized by your system. By default, it outputs to standard out. You can run the free utility without any flags to get an idea about how ... Read More

Difference Between sh and Bash in Linux?

Satish Kumar
Updated on 01-Dec-2022 08:51:52
Bash is a BourNeSh (Bourne Again ShEl) which is an improved variant oF thE origiNal Bourne shEll.It is used to run programs in the Bash programming language, and is often referred to as "the default shell" for Linux distributions. Sh is a simple commandinterpreter for the UNIX System V Release 4.0. Both Bash and sh can be used to write scripts in various languages such as Perl, Python, Ruby, PHP, Java, C++, JavaScript, Tcl, SQL, and others. sh #!/bin/sh bash #!/bin/bash Note A shell is an interface between the end-users and the operating systems. sh implements the ... Read More