Found 1437 Articles for Linux

How to compare two sorted files line by line in the Linux system?

Shilpa S
Updated on 30-Jun-2021 15:01:06

2K+ Views

To compare two sorted files, we use the comm command in the Linux system.The comm command is used to compare two sorted files line by line and writes three columns to standard output. The first two columns contain lines unique to the first and the second file and the last column contains lines common to both. Columns are distinguished with the tab. The functionality of the comm command is similar to the diff command.SyntaxThe general syntax of the comm command is as follows −comm [OPTION]... FILE1 FILE2Brief description of options available in the comm command.Sr.No.Option & Description1-1Suppress first column (lines ... Read More

How to check total space and available space in Linux using the terminal?

Shilpa S
Updated on 30-Jun-2021 15:00:20

679 Views

In the Linux/Unix system to check storage details, we use the df command.df (disk free) command the df command is used to report file system disk space usage using the terminal in the Linux system. It displays total space, used space, and available space.SyntaxThe general syntax of the df command is as follow:$ df [OPTION]... [FILE]...Brief description of options available in the df command.Sr.No.Option & Description1-a, --allInclude duplicate, pseudo, inaccessible file systems2-B, --block-size=SIZEScale sizes before printing3-h, --human-readableDisplay sizes in powers of 10244-H, --siDisplay sizes in powers of 10005-l, --localLimit listing to local file systems6--no-syncDon’t synchronize before getting usage info7--syncSynchronize before getting ... Read More

How to change the shell working directory in Linux?

Shilpa S
Updated on 30-Jun-2021 14:59:31

1K+ Views

To change the shell working directory, we use the cd command in the Linux system.cd (change directory) The cd command used to change the current working directory in the Linux/Unix operating system. In the Windows operating system for the same purpose the cd or chdir command available. The cd command also available in the EFI shell (Extensible Firmware Shell). By default, the current shell working directory is home directory.SyntaxThe general syntax of the cd command is as follows −cd [-L| [-P [-e]] [-@]] [directory]A brief description of options available in the cd command.Sr.No.Option & Description1-LForce soft links to as followedResolve symbolic ... Read More

How to change the file owner and group in Linux?

Shilpa S
Updated on 13-Sep-2023 14:22:17

28K+ Views

To change the file owner and group, we use the chown command in the Linux operating system.We know that Linux is a multiuser operating system so every file or directory belongs to an owner and group.To change ownership of files or directories we use chown command in the Linux system. This command is also available in the IBM i operating system. The chgrp command is also used to change only the group ownership of the file in the Linux system.SyntaxThe general syntax of the chown command is as followschown [OPTION]... [OWNER] [: [GROUP]] FILE... chown [OPTION]... --reference=RFILE FILE...A brief description ... Read More

How to change file or directory permission in Linux/Unix?

Shilpa S
Updated on 30-Jun-2021 09:28:07

1K+ Views

We know that the Linux/Unix is a multiuser operating system files and directories are associated with permission so that only authorized users can access the files.The chmod command is used to change the access permission of files or directories.SyntaxThe general syntax of the chmod command is as follows −chmod [OPTION]... [Mode]... [File]...Syntax of chmod command is as followed, it contains some three parameters that will help to set or change the permission of the file.We will discuss each parameter in detail so that you can have a better idea of using the chmod command.A brief description of options available in ... Read More

Screenshot of a particular element with Python Selenium in Linux

Debomita Bhattacharjee
Updated on 08-Apr-2021 07:45:08

481 Views

We can capture a screenshot of a particular element with Selenium webdriver in Python. To achieve this task, first we have to identify the element which we want to identify with the help of any locators like id, xpath, css, name, class name, tagname, link text or partial link text.After the element has been identified, we can capture its screenshot with the help of the screenshot method. We have to pass the file name where the screenshot shall be stored (along with extension) as a parameter to this methodSyntaxm=driver.find_element_by_tag_name("h4") m.screenshot("logo.png")Let us capture the screenshot of the highlighted text below −Examplefrom ... Read More

Explain BLOB object and tree object in Git.

kannan sudhakaran
Updated on 20-Feb-2021 09:04:17

1K+ Views

Git uses a series of BLOBs and trees to store content of the working directory of a project. Whenever we perform a commit operation, Git internally creates a series of trees and BLOBs, which is the binary representation of the project folder structure at that point in time of commit.What is BLOB?BLOB stands for Binary Large Object. Each version of a file in Git is represented as a BLOB. A BLOB holds a file’s data but doesn’t contain any metadata about the file or even its name.To understand a BLOB let us see an example.Create 3 files “file1.txt”, “file2.txt” and ... Read More

What is the short status in Git?

kannan sudhakaran
Updated on 20-Feb-2021 09:01:52

2K+ Views

The git status command returns the current state of the −Working areaStaging areaThis command returns tracked and untracked files and changes made to the repository. However, this command does not show any commit records or information. This command usually returns a status message denoting one of the following states −No commit historyUntracked filesChanges pending to be committedClean working treeModified filesDeleted filesThe syntax for using the git status command is given below −$ git statusA screenshot of the above command’s output is below. The output indicates that the file has been modified.dell@DESKTOP-N961NR5 MINGW64 /e/tut_repo (master) $ git status On branch master ... Read More

How do we stash changes in Git?

kannan sudhakaran
Updated on 20-Feb-2021 08:59:46

677 Views

This question can be rephrased as "How to save work in progress (WIP) in Git and return to it later when convenient?"The problem − When we switch branches, Git resets our working directory to contain the snapshot stored in the last commit of the target branch. For example, if we switch from feature to the master branch, Git will replace contents in the working directory with the last commit of the master branch. But if we have local changes in our working directory that we haven't committed yet, these changes will be lost. In this situation, Git will not allow ... Read More

How to compare two branches in Git?

kannan sudhakaran
Updated on 20-Feb-2021 08:57:04

2K+ Views

Collaborators will use multiple branches in order to have clearly separated codebase. At some point in time, we may have to merge these branches in order to have the resulting work in the main branch. It is important that we compare the differences in the branches before merging to avoid any conflicts. We will see a couple of different ways to compare two branches −Listing commit differences − This method shows commits that are present in a branch but unavailable in the other branch.Listing file changes − This method compares branches and displays how exactly a certain file is different ... Read More

Advertisements