
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2003 Articles for Operating System

12K+ Views
In order to be able to invert a grep expression on Linux command line, we must first understand what a grep command is and how to use it on Linux.The grep command in Linux is used to filter searches in a file for a particular pattern of characters. It is one of the most used Linux utility commands to display the lines that contain the pattern that we are trying to search.Normally, the pattern that we are trying to search in the file is referred to as the regular expression.Syntaxgrep [options] pattern [files]While there are plenty of different options available ... Read More

865 Views
Installing the latest version of Git on CentOS can be done in many ways. Below are three approaches for the same.Approach 1Commandsyum install epel-release yum remove git rpm -U https://centos7.iuscommunity.org/ius-release.rpm yum install git2u git --versionOutputimmukul@192 lib % git --version git version 2.29.2Approach 2Commandsyum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker export GIT_VERSION=2.29.2 mkdir /root/git cd /root/git wget "https://www.kernel.org/pub/software/scm/git/git-2.29.2.tar.gz" tar xvzf "git-2.29.2.tar.gz" cd git-2.29.2 make prefix=/usr/local all make prefix=/usr/local install yum remove -y git git --versionOutputimmukul@192 git-2.29.2 % git --version git version 2.29.2Approach 3Commandssudo yum -y install https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm sudo yum install git git --versionOutputimmukul@192 git-2.29.2 % ... Read More

3K+ Views
In order to insert text at the beginning of a text file we must be familiar with either the sed command as the sed commands can be used to solve the above problem.Let’s first explore the sed command, which is short for stream editor. This command is used to perform different functions like find, replace, insert and many more on a particular file.Consider we have a directory d1 in which two .txt files are present and the directory looks something like this −immukul@192 d1 % ls -ltr total 8280 -rwxrwxrwx 1 immukul staff 4234901 Jul 7 17:41 ... Read More

5K+ Views
We know that we can make use of the grep command to search for a particular pattern of characters in all the lines of a file or multiple files. The grep command performs a case-insensitive search for words in a file.Let’s see a simple example where we will grep a pattern in all the files that are present in a directory.Commandgrep -i ‘lp’ Sample*OutputSample: The sample was printed via the internet. Sample: I believe lp cares about what the device is. Sample1: This was printed via the internet. Sample1: I believe lp cares about what the device is. Sample2: This ... Read More

2K+ Views
In order to be able to grep multiple lines of pattern present in a file, we will make use of the number of grep command that Linux provides us with. But first, we must understand what a grep command is and how to use it on Linux.The grep command in Linux is used to filter searches in a file for a particular pattern of characters. It is one of the most used Linux utility commands to display the lines that contain the pattern that we are trying to search.Normally, the pattern that we are trying to search in the file ... Read More

4K+ Views
While there are plenty of ways to print and make use of specific words from a particular file in a Linux directory, when we talk about grepping a particular word and then replacing it with some other word, then we will need to mix certain Linux utility commands.The two Linux utility commands that we must be aware of are −find − used to locate a particular file or directorysed −short for stream editor and is used to perform functions like searching, editing and replacing.In order to solve the problem of grep and replace a particular word we will make use ... Read More

4K+ Views
The grep command in Linux is used to filter searches in a file for a particular pattern of characters. It is one of the most used Linux utility commands to display the lines that contain the pattern that we are trying to search.Normally, the pattern that we are trying to search in the file is referred to as the regular expression.Syntaxgrep [options] pattern [files]While there are plenty of different options available to us, some of the most used are −-c : It lists only a count of the lines that match a pattern -h : displays the matched lines only. ... Read More

875 Views
Whenever we want to get an update about a specific process or different process we make use of the ps command which is short for “Process status” that tells us about the state of the current process and its characteristics and a whole lot more.When clubbed with several flags and commands we can enhance the ps command to output the start time of different processes that are running on a particular Linux machine.The command to print the time of long running processes in increasing order is shown below −For Ubuntu and other Linux based Systems −ps -eo pid , lstart ... Read More

1K+ Views
We make use of the bash files to store different variables that we normally refer to as the environment variables. We can later access these variables easily by just printing them with the help of the echo utility command tha linux provides us with.ExamplePrint the $PATH environment variable.Commandecho $PATHOutputimmukul@192 src % echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/Us ers/immukul/.cargo/binNow as we can see that the PATH environment variable is made of different directories, and suppose we want the last file name from the path variable.In that case, we would make use of the base name command utility that Linux provides us with.The base name ... Read More

1K+ Views
Linux find statement is one of the most widely used statements that allows us to walk a file hierarchy. It is used to mostly find a specific file or directories and we can also append different other Linux statements or flags along with it to enhance or do a complex operation.Let’s explore an example of a find statement to understand it better.In the linux code shown below I am trying to search for a file inside my Downloads folder, and for that I am making use of the find statement.find sample.shOutputsample.shNotice that if the find command is able to locate ... Read More