Understanding Double Dot and Single Dot in Linux

Kunal Verma
Updated on 19-Dec-2022 12:30:22

2K+ Views

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

Run Shell Script on Remote Machine through SSH

Kunal Verma
Updated on 19-Dec-2022 12:29:01

8K+ Views

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

Check If a File Type Exists in a Directory

Kunal Verma
Updated on 19-Dec-2022 12:27:11

1K+ Views

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 Specific File Types on Linux

Kunal Verma
Updated on 19-Dec-2022 12:25:45

496 Views

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

Object Literals vs Constructors in JavaScript

Aman Kumar
Updated on 19-Dec-2022 12:23:29

1K+ Views

Object literals and constructors both are used to create an Object in JavaScript. An object created by the object literals is a singleton. This means when a change is made to the object, it affects that object across the entire script. If an object created by a function constructor has multiple instances of the object. This means the changes made to one instance, will not affect other instances. Object Literal Notation − Let’s create user details where we have the key, name, age, and name of the company. So we are creating an object named userDetails. const userDetails = {name: "Aman", ... Read More

Clone JS Object Except for One Key in JavaScript

Aman Kumar
Updated on 19-Dec-2022 12:21:28

1K+ Views

In computer programming, cloning refers to an object copied by a method or copy factory function often called clone and copy. The easiest way to clone an object except for one key would be to clone the whole object and then remove the property that is not required. Cloning, however, can be of 2 types − Deep Clone Shallow Clone Shallow Clone The shallow clone copies as little as possible. For example, a shallow copy of a collection might be a copy of the collection’s structure, not its elements. With a shallow copy, two collections now share individual ... Read More

Convert String to Date in JavaScript

Aman Kumar
Updated on 19-Dec-2022 12:11:06

4K+ Views

In this article, we are going to discuss how to convert a string value to a Date object in JavaScript. There are two ways to achieve this − Using the constructor of the Date class − This constructor accepts a string value representing the date value, converts it into a Date object, and returns the result. Using the Date.parse() method − Same as the Date constructor this method accepts a string value parses and returns the date value in the form of milliseconds. Let us see these solutions with examples − Using the Date() constructor The most commonly used way ... Read More

The Return Statement in Python

Sarika Singh
Updated on 19-Dec-2022 12:09:39

3K+ Views

The return statement in python is an extremely useful statement used to return the flow of program from the function to the function caller. The keyword return is used to write the return statement. Since everything in python is an object the return value can be any object such as – numeric (int, float, double) or collections (list, tuple, dictionary) or user defined functions and classes or packages. The return statement has the following features - Return statement cannot be used outside the function. Any code written after return statement is called dead code as it will never ... Read More

Insert String at Position X of Another String Using JavaScript

Aman Kumar
Updated on 19-Dec-2022 12:07:26

927 Views

In this article, you are going to learn how to insert a string at a position in another string. JavaScript does not give a direct way to achieve this. For this, we can use the slice method. The slice method extracts a section of a string and returns a new string. In addition to the slice() method we can also use the methods join() and substr(). Using the slice() Method of the String class This slice() method gets parts of the string and returns the extracted part from the string and makes a new string. Following is the syntax ... Read More

Segregate 0s and 1s in an Array List Using Python

Sarika Singh
Updated on 19-Dec-2022 12:06:22

1K+ Views

The elements in the contiguous memory address are contained in the linear data structure known as an array. At these places, it primarily groups components of the same data type. Given an array of integers. The array is to be divided into two halves, 0s and 1s, according to the article "Segregate 0s and 1s in an array." The array should have all the 0’s on the left and all the 1’s on the right. Input-Output Scenario Let’s consider an input and its output scenarios to segregate 0’s and 1’s in an array list - Input: [0, 1, ... Read More

Advertisements