7 Oct 2014

Linux command tar grep find ssh

 tar command examples

$ tar xvf archive_name.tar
View an existing tar archive.
$ tar tvf archive_name.tar
More tar examples: The Ultimate Tar Command Tutorial with 10 Practical Examples

 grep command examples

Search for a given string in a file (case in-sensitive search).
$ grep -i "the" demo_file
Print the matched line, along with the 3 lines after it.
$ grep -A 3 -i "example" demo_text
Search for a given string in all files recursively
$ grep -r "ramesh" *
More grep examples: Get a Grip on the Grep! – 15 Practical Grep Command Examples

Create a new tar archive.
$ tar cvf archive_name.tar dirname/
Extract from an existing tar archive.

No comments:

Post a Comment