I have been using the command below for file manipulation.
So, if a certain string is found in f2 (for ex; DOG243435) and it is also present in f1, then print that string plus the contents of the line in which it was found onto f3.
this works great, however, I wanted to know how I can avoid grepping for a string if a certain phrase is stated before that string. In the example below, if the word contained appears, I do not want to grep the string "DOG23244" after it.. How can I avoid only grepping DOG00912 and the contents of that line and NOT DOG23244 if the word contained appears?
i tried to ask about this earlier, but didn't explain well enough. From a script, i issue the following:
echo `pgp --encrypt filename --recipient public-key`
The result is perfect. The encrypted file is in the directory just as if i'd issued the pgp command from the command line.
However,... (0 Replies)
Hi,
We have umask 022 in /etc/profile for security reasons.
But I want have some other umask for selected users. how to achieve this?
Regards (3 Replies)
I am running Linux 2.6.20 on i686 architecture.
I want to be able to masquerade different hosts on my LAN to different external interfaces. Specifically, I want one specific host to masquerade through a vpn tunnel while the other hosts simply masquerade over the regular ISP interface. I only... (4 Replies)
hi all
from below text
"abcd,SYS_12345,xyz,PQR, ,"
I want to print only
"abcd,SYS,xyz,PQR, ,"
i.e. taking only first three 3 chars from 2 string of comma separated file
thanks (4 Replies)
Hi all
:wall:
Can anyone advise how do I use ls to do a selective amd sorted listing of file that I want to have as below?
Am looking for files that are named as log_<nnnn>.txt, where <nnnn> are numeric, i.e. I want to have a listing sorted from the newest to the oldest of files that... (7 Replies)
I have to grep out only email address from a column. It has characters appended and prepended
F=<sss1@domain.com>
<sss2@domain.com>
(sss3@domain.com)
<sss4@domain.com>
Whatever added before and after email, I should be able to grep out only emails. (9 Replies)
I have a text file in this format.
Group: AAA
Notes: IP : 11.11.11.11
#User xxxxxxxxx
#Password aaaaaaaaaaaaaaaa
Group: AAA
Notes: IP : 11.11.11.22
#User yyyyyyyyyyyyy
#Password bbbbbbbbbbbbb (8 Replies)
i have a large sequence of format
sat_1_g3_g_0_8540 . A 1 15501 . . . ID=sat_1_g3_g_0_8540;parentName=sat_1_g3_g_0_8540;Al=sat_1_g2_g_0_8540;
sat_1_g3_g_2_8510 . C 1 25501 . . . ... (11 Replies)
I have the following contents in a file
---- CRITICAL: altered for /usr/bin/bin1 ---- OK: /usr/sbin/bin2 result fine ---- OK: /usr/sbin/bin3 result fine ---- CRITICAL: altered for /usr/bin/bin4 ---- OK: /usr/bin/bin5 result fine ---- OK: /usr/bin/bin6 result fine ---- CRITICAL: altered for... (9 Replies)
I have
MegaCli64 -PDList -aALL | grep -E 'Enclosure Device ID|Slot Number'
Enclosure Device ID: 252
Slot Number: 0
Enclosure Device ID: 252
Slot Number: 1
Enclosure Device ID: 252
Slot Number: 2
Enclosure Device ID: 252
Slot Number: 3
I need to run the following command on all slots... (4 Replies)
Discussion started by: anil510
4 Replies
LEARN ABOUT V7
zgrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)ZGREP(1)