Month: July 2011

How to find block size in Linux and Unix

This a small how-to on getting block size of a file system in your Linux machine. To go in to that info we have to learn bit information about file-system. What is a file-system? In simple, its a way we write data on to Disks is called as file-system. There are many File-systems supported by Linux. What is  block size in Linux? A block is a sequence of bit or Bytes with a fixed length ie 512 bytes, 4kB, 8kB, 16kB, 32kB etc. blockdev --getbsz partition Example # blockdev --getbsz /dev/sda1 4096 So the block size of this file...

Read More

18 Linux grep command examples for a data analysis

GREP is a command line search utility or tool to filter the input given to it. Grep got its name from ed editor as g/re/p (global / regular expression / print). Grep command can improve a command output by filtering out required information. Grep will become a killer command when we combined it with regular expressions. In this post we will see how to use grep in a basic way and then move on some advanced and rarely used options. In our next couple of posts we will see what grep can do with the help of regular expressions....

Read More

Regular expressions in Linux -II

Regular Expression in Linux/Unix Part 2 This is our second part on Regular Expressions in Linux. Please have a look at our first part here. Interval Regular expressions These are used to mention no of character/character set reputation info. Note that interval regular expression and extended reg require -E option with grep Note: In order to use this set of regular expressions you have to us -E with grep command and -r option with sed commands   {n} –n occurrence of previous character {n,m} – n to m times occurrence of previous character {m, } –m or more occurrence...

Read More

Regular Expressions in Linux Explained with Examples

Regular expressions (Regexp)is one of the advanced concept we require to write efficient shell scripts and for effective system administration. Basically regular expressions are divided in to 3 types for better understanding. 1)Basic Regular expressions 2)Interval Regular expressions (Use option -E for grep and -r for sed) 3)Extended Regular expressions (Use option -E for grep and -r for sed) Some FAQ's before starting Regular expressions What is a Regular expression? A regular expression is a concept of matching a pattern in a given string. Which commands/programming languages support regular expressions? vi, tr, rename, grep, sed, awk, perl, python etc. Basic Regular Expressions...

Read More

Get latest updates for free..!

Enter your email address:

Delivered by FeedBurner

Pin It on Pinterest