Posts

Showing posts from May, 2015

grep | dd create huge file | sed | touch

To search over many fles and fnd out in which of the fles a certain text matches use: $ grep - l linux sample1. txt sample2 . txt sample1. txt sample2. txt To recursively search for a text over many directories of descendants use: $ grep " text" . -R - n Instead of using the current time for the timestamp, we can specify the time and date with which to stamp the fle as follows: $ touch -d "Fri Jun 25 20: 50: 14 IST 1999" filename Another way to print symbolic links is to use find as follows: $ find . - type l - print The following command will create a fle that is 1 GB in size. $ dd if=/dev/zero of=loopbackfile. img bs=1G count=1 We can also read from stdin as follows: $ echo - e "this is sed can be used to replace occurrences of a string with another string in a given text. It can be matched using regular expressions. $ sed ' s/pattern/replace_string/' file & is a string which corresponds to match string for the given patt

tty command

tty - print the file name of the terminal connected to standard input    

text from rows to line

cat a | tr -d '\n' # text from rows to line