Posts

Showing posts from 2015

How to compress tar archives using gzip and bzip2

Image
In our last post we discussed how to stack multiple files and directories to create a single tar archive. In most cases these archives needs to be compressed  and in order to perform compression additional compression programs need to be used. In this post we are discussing two such programs, gzip and bzip.

How to archive files in linux using tar command

Image
Data archiving in Linux is the method of  storing one or more files into a single file for backup or distribution (transferring files locally or through network)  purpose. There are many tools available in Linux that can perform data archiving. In this post we will discuss  about tar, which is the basic command line archiving utility available in Linux. tar command can archive files on a local disk as well as on a tape device. Similarly it can extract data from an archive file as well as from the tape device. The syntax of tar command is

Regular Expressions explained with grep command.

Image
In our earlier post regarding standard wildcard we saw how wildcards are mostly used with shell commands to replace or represent  one or more characters. Eventhogh similar to standard wildcard, a regular expression or regex is a method of using a sequence of characters to match a wider range of search patterns. In this tutorial I will try to explain regular expressions using grep, awk and sed commands. Before that lets see different regex operators and their meanings.

Understanding sed command with example -Part 2

sed is a *nix stream editor command with the ability to filter and transform input text files line by line. sed command works very well with awk command and they are used together by System Administrators to simplify day to day activities. The syntax for sed command is sed [options] commands <input-file> In the earlier post we saw how to print, quit and delete a particular line with sed command. In this second of the two post series on sed we will cover 3 more widely used commands. They are  Substitute (s/../../) command Change (c \) command Insert (i \) command 

Understanding sed command with example -Part 1

sed is a *nix stream editor command with the ability to filter and transform input text files line by line. sed command works very well with awk command and they are used together by System Administrators to simplify day to day activities. The syntax for sed command is sed [options] commands <input-file> One thing that distinguishes sed from other editors are its ability to filter text in a pipeline. In this first of the two post series on sed we will cover 3 of the most often used commands. They are Print (p) command Quit (q) command Delete (d) command

How to find serial number and other hardware details of Laptop/PC/Server from command line using dmidecode

Whether you are checking your hardware's  warranty or trying to raise a support ticket, the first thing your hardware vendor will ask is the serial number and model name of your your Laptop/PC/Server. In most cases a laptop's serial number is printed at the bottom and for a  PC or a Server, it will be located at the rear side. But what if the serial number printed is tampered or faded. What if the machine is located in a remote location. In such situations we use dmidecode command to obtain the hardware details.

Understanding awk command with examples

Image
Awk is a simple and powerful programming language used for processing text files. It is widely used by system administrators as a data manipulation, extraction and reporting tool. Awk treats every file as a sequence of records and by default each records are separated by a new line. Each record consist of one or more fields which are by default separated by a space. The syntax for awk command is

Linux File Special Permissions - Sticky Bit

Image
This is last of the three series posts regarding Linux special file permissions. We know that in addition to the basic file permission there are three more  special permissions. They are Set User ID (SUID) Set Group ID (SGID) Sticky Bit and in this post will cover Sticky Bit

Linux File Special Permissions - SGID

Image
This is second of the three series posts regarding Linux special file permissions. We know that in addition to the basic file permission there are three more  special permissions. They are Set User ID (SUID) Set Group ID (SGID) Sticky Bit and in this post will cover SGID

Linux File Special Permissions - SUID

Image
In an earlier post we saw different types of basic Linux file permissions. In addition to the basic file permission there are three more  special permissions. They are Set User ID (SUID) Set Group ID (SGID) Sticky Bit

How to change ownership of a file

Image
In our previous posts we saw how to change the permission on a file for  different users. Now lets see how to change the ownership of a file. To change the ownership /group ownership of  file or a directory we use chown command. Syntax for chown command is

Basic chmod examples

Image
In our previous post we discussed how to change the permission or mode of a file with chmod command. Now lets see few basic examples regarding how to use chmod via Command Line Interface

How to change the permission of a file in Linux?

Image
In the last post we discussed about the basic file permission. Now lets see how to change the permission of a file or a directory in Linux. To change the access rights we use the chmod command.

Linux File Permissions - Basics

Image
In a multi-user operating system, there will be more than one user account probably handled by different users. What would happen if all the user accounts have permission to access each and every file or command in an operating system? There is a chance for a complete disaster. To avoid such a scenario filesystem has a method to assign access permission to specific system users and groups. The ability of a user to  view, modify and run a particular file or a directory depends upon this access right.