Sponsored Content
Full Discussion: Grep -v command
Top Forums UNIX for Beginners Questions & Answers Grep -v command Post 303038787 by gull04 on Friday 13th of September 2019 08:05:47 AM
Old 09-13-2019
Hi,

Using the data that you provided in the previous post and the "grep" already supplied I get;

Code:
[e434069@fbakirpomd4 data]$ grep -v " [01] *[+-]" test_01.txt
chr10 85504 85558 NB551726:5:H2HT5BGXC:2:22211:7601:16419 31 +
chr10 146518 146570 NB551726:5:H2HT5BGXC:1:22112:11102:14366 14 -
chr10 232590 232630 NB551726:5:H2HT5BGXC:1:12308:2911:4998 18 +
chr10 233673 233721 NB551726:5:H2HT5BGXC:1:11204:24661:6499 24 +
chr10 244426 244461 NB551726:5:H2HT5BGXC:4:22610:1450:10242 22 -
chr10 283223 283277 NB551726:5:H2HT5BGXC:1:21202:24027:11672 44 +
chr10 287019 287063 NB551726:5:H2HT5BGXC:1:22210:5587:11665 28 +
chr10 336049 336112 NB551726:5:H2HT5BGXC:4:21402:23402:10596 36 -
chr10 362697 362752 NB551726:5:H2HT5BGXC:1:11101:11174:14176 42 -
chr10 371287 371340 NB551726:5:H2HT5BGXC:4:11602:10047:13747 44 +
chr10 388618 388671 NB551726:5:H2HT5BGXC:1:11306:6809:18821 24 +
chr10 420131 420159 NB551726:5:H2HT5BGXC:2:23203:13675:14982 22 -
chr10 476607 476640 NB551726:5:H2HT5BGXC:3:22501:13073:17530 22 -
chr10 500144 500198 NB551726:5:H2HT5BGXC:2:11301:24584:1760 44 +
chr10 585380 585424 NB551726:5:H2HT5BGXC:2:12304:5393:1266 9 +
chr10 685059 685121 NB551726:5:H2HT5BGXC:1:21101:21058:3630 11 +
chr10 814780 814815 NB551726:5:H2HT5BGXC:4:13412:1664:12073 22 +
chr10 837668 837722 NB551726:5:H2HT5BGXC:1:11101:25458:6217 44 +
chr10 947014 947075 NB551726:5:H2HT5BGXC:2:12102:8014:4477 17 -
chr10 973816 973878 NB551726:5:H2HT5BGXC:1:11101:10787:4355 22 +
chr10 1037982 1038035 NB551726:5:H2HT5BGXC:3:13608:13694:9588 44 -
chr10 1046219 1046262 NB551726:5:H2HT5BGXC:1:21202:3219:4865 2 -
chr10 1104334 1104387 NB551726:5:H2HT5BGXC:1:12103:16042:13671 44 +
chr10 1195895 1195988 NB551726:5:H2HT5BGXC:1:11106:13477:18629 24 +
chr10 1367503 1367553 NB551726:5:H2HT5BGXC:4:22610:5848:13809 24 +
chr10 1431352 1431392 NB551726:5:H2HT5BGXC:4:13601:10331:9778 9 +
chr10 1526949 1527003 NB551726:5:H2HT5BGXC:1:11106:4035:1555 44 +
chr10 1549714 1549765 NB551726:5:H2HT5BGXC:1:11205:14522:3538 44 +
chr10 1580121 1580165 NB551726:5:H2HT5BGXC:1:21206:18826:14008 11 +
chr10 1842110 1842171 NB551726:5:H2HT5BGXC:2:11310:26839:10836 28 +
chr10 1881715 1881753 NB551726:5:H2HT5BGXC:2:11205:3952:19358 2 +
chr10 1922335 1922390 NB551726:5:H2HT5BGXC:3:11602:6835:13982 44 +
chr10 1991697 1991766 NB551726:5:H2HT5BGXC:1:13212:5870:20182 36 +
chr10 2101162 2101215 NB551726:5:H2HT5BGXC:1:21107:12547:7522 44 +
chr10 2292698 2292726 NB551726:5:H2HT5BGXC:3:13403:8382:4801 22 -
chr10 2366208 2366259 NB551726:5:H2HT5BGXC:1:12212:14624:16575 40 +
chr10 2396479 2396509 NB551726:5:H2HT5BGXC:3:22509:15130:13568 9 +
chr10 2396527 2396581 NB551726:5:H2HT5BGXC:2:22301:3292:6255 2 +
chr10 2518990 2519044 NB551726:5:H2HT5BGXC:1:11109:9354:2230 41 -
chr10 2570819 2570875 NB551726:5:H2HT5BGXC:1:11101:17058:14296 22 -
chr10 2598458 2598510 NB551726:5:H2HT5BGXC:4:23402:11741:2459 9 -
chr10 2645231 2645267 NB551726:5:H2HT5BGXC:4:23407:13046:7808 22 -
chr10 2664360 2664405 NB551726:5:H2HT5BGXC:1:12212:2600:16692 2 -
chr10 2689748 2689785 NB551726:5:H2HT5BGXC:2:13101:24861:12307 22 -
chr10 2757729 2757782 NB551726:5:H2HT5BGXC:2:13110:17135:7589 44 +
chr10 2767042 2767088 NB551726:5:H2HT5BGXC:1:22107:4789:12466 2 +
chr10 2803427 2803454 NB551726:5:H2HT5BGXC:2:11203:24404:19669 22 -
chr10 2814113 2814167 NB551726:5:H2HT5BGXC:1:12305:14313:9805 44 -
chr10 3034873 3034907 NB551726:5:H2HT5BGXC:1:23109:21910:9724 2 +
chr10 3420171 3420224 NB551726:5:H2HT5BGXC:1:12210:2214:14077 41 -
chr10 3420565 3420622 NB551726:5:H2HT5BGXC:1:11104:13745:15948 36 +
chr10 3606289 3606342 NB551726:5:H2HT5BGXC:2:11112:20795:16887 44 -
chr10 3618574 3618610 NB551726:5:H2HT5BGXC:1:13207:15169:14738 24 -
chr10 3621035 3621064 NB551726:5:H2HT5BGXC:2:11307:6461:10417 22 -
chr10 3646540 3646586 NB551726:5:H2HT5BGXC:2:22110:5058:7733 11 +
chr10 3647767 3647804 NB551726:5:H2HT5BGXC:1:11101:24494:6143 22 +
chr10 3681373 3681414 NB551726:5:H2HT5BGXC:3:21404:25227:19317 2 -
chr10 3683054 3683110 NB551726:5:H2HT5BGXC:1:11107:12183:9835 19 +
chr10 3687341 3687385 NB551726:5:H2HT5BGXC:3:22603:1787:10818 9 -
chr10 3731481 3731507 NB551726:5:H2HT5BGXC:4:13407:26161:10111 22 +
chr10 3773260 3773316 NB551726:5:H2HT5BGXC:1:11101:8820:18166 22 +

Which looks to be correct.

Regards

Gull04
These 2 Users Gave Thanks to gull04 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep command

What is the meaning of this grep -v $object grant_BU.sql>temp (1 Reply)
Discussion started by: debasis.mishra
1 Replies

2. UNIX for Dummies Questions & Answers

grep command

hi all i have directory /usr under this directory i have subdirectories tmp1,tmp2,tmp3 like this /usr/tmp1 /usr/tmp2 /usr/tmp3 and so on i want to search string in files (i don't know the name of the files)and i want to serch it in all the directories under the /usr how shell i do... (3 Replies)
Discussion started by: naamas03
3 Replies

3. UNIX for Advanced & Expert Users

how to exclude the GREP command from GREP

I am doing "ps -f" to see my process. but I get lines that one of it represents the ps command itself. I want to grep it out using -v flag, but than I get another process that belongs to the GREP itself : I would like to exclude # ps -f UID PID PPID C STIME TTY TIME CMD... (2 Replies)
Discussion started by: yamsin789
2 Replies

4. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies

5. Shell Programming and Scripting

Help with using grep command with copy command

Hi, im taking an entry Unix class, and as part of my lab assignment I have to copy all files in the /home/david/lab3 directory that have the file extension .save to your lab3/temp directory. I'm having trouble getting the grep to do anything worth while I've been trying to do: cp... (6 Replies)
Discussion started by: Critical jeff
6 Replies

6. Shell Programming and Scripting

Grep Command

Hi, I have around 500 Text files and Each file will be having either String1 or String2. I want to list the file only which has String1 and Sting2 in a single command.. (5 Replies)
Discussion started by: balasubramani04
5 Replies

7. Shell Programming and Scripting

help on grep command...

Hi I have lots of file in on folder and i want to egrep from only few files. List of files...... Polt_KJ_430_OutputRBS_istUt_CR2.log Polt_KN_4122_OutputRBS_ncChk_CR.log Polt_LN_2230_OutputRNC_Hth_CLKLKL.log Solt_KJ_430_OutputRBS_istUt_CR2.log Solt_KN_4122_OutputRBS_ncChk_CR3.log... (2 Replies)
Discussion started by: asavaliya
2 Replies

8. Shell Programming and Scripting

Grep command

grep -i -f panel_genes.txt hg19_refGene.txt > match.txt seems to be pulling names the do not exist in the input file (panel_genes.txt) - the output is attached as well (match.txt) For example, RNF185 or ZNF146 are not genes in the input. I am trying to match the input file genes only and am... (9 Replies)
Discussion started by: cmccabe
9 Replies

9. Shell Programming and Scripting

Grep command giving different result for different users for same command

Hello, I am running below command as root user #nodetool cfstats tests | grep "Memtable switch count" Memtable switch count: 12 Where as when I try to run same command as another user it gives different result. #su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch... (10 Replies)
Discussion started by: Pushpraj
10 Replies

10. UNIX for Beginners Questions & Answers

Help on grep command

for example i have a directory home/solaris/unix/samplefiles/ with defaults files in it.. those default files have 1 word in common "UNIX". how can i list the files without "UNIX" words in it using grep command thanks, im using unix solaris, korn shell.. (1 Reply)
Discussion started by: daveaztig14
1 Replies
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy