unix has several additional pieces of (Web hosting rating) information associated

unix has several additional pieces of information associated with it. unix counterparts, but implement a few nice options which makes their unix files names, but they are, and handling them correctly is Reading From STDIN When no files are specified, grep looks for matches on the lines that are entered on STDIN. This makes it perfect for attaching to pipes. For example, the following command looks for all users named ranga in the output of the who command: $ who | grep ranga ranga tty1 Aug 26 14:12 ranga ttyp2 Nov 23 14:15 (rishi.bosland.u) The -v Option Most of the time you use grep to search through a file looking for a particular word, but sometimes you want to acquire a list of all the lines that do not match a particular word. Using grep, this is simple –specify the -v option. For example, the following command produces a list of all the lines in /etc/passwd that do not contain the word home: $ grep -v home /etc/passwd On my system, the output looks like the following: root:*:0:3::/:/sbin/sh daemon:*:1:5::/:/sbin/sh bin:*:2:2::/usr/bin:/sbin/sh sys:*:3:3::/: adm:*:4:4::/var/adm:/sbin/sh uucp:*:5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico lp:*:9:7::/var/spool/lp:/sbin/sh nobody:*:-2:-2::/: One common use of the -v option is to parse the output of the ps command. For example, if I were looking for all instances of bash that were running on a system, I could use the following command: $ /bin/ps -ef | grep bash Sometimes the output looks like the following: ranga 3277 3276 2 13:41:45 pts/t0 0:02 -bash ranga 3463 3277 4 18:38:26 pts/t0 0:00 grep bash The second process in this list is the grep that I just ran. Because it is not really an instance of bash, I can get rid of it as follows:
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Leave a Reply