Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 2
    the --line-number (-n) argument to grep could be useful for obvious reasons Commented Sep 1, 2018 at 0:48
  • Doesn't grep '[^ATCG]' just look for A, T, C & G in the first column? Commented Sep 1, 2018 at 7:23
  • @RonJohn No. The ^ has a totally different meaning when it occurs as the first character within [...] (it negates the character class). Commented Sep 1, 2018 at 7:31
  • I knew I should have added "not"... :) Thus, doesn't grep '[^ATCG]' look for any row which does not have A, T, C & G in the first column? Commented Sep 1, 2018 at 7:48
  • @RonJohn No. It looks for lines of text where at least one character is not A, T, C or G. The [...] means "one of these characters", and with the ^ at the start of that group, it means "a character, but not one of these". Commented Sep 1, 2018 at 8:04