Linked Questions

430 votes
4 answers
821k views

Take the following script: #!/bin/sh sed 's/(127\.0\.1\.1)\s/\1/' [some file] If I try to run this in sh (dash here), it'll fail because of the parentheses, which need to be escaped. But I don't need ...
detly's user avatar
  • 5,400
176 votes
5 answers
71k views

I see POSIX mentioned often and everywhere, and I had assumed it to be the baseline UNIX standard.. until I noticed the following excerpt on a Wikipedia page: The Open Group The Open Group is most ...
Peter.O's user avatar
  • 33.8k
58 votes
11 answers
162k views

It seems I am misusing grep/egrep. I was trying to search for strings in multiple line and could not find a match while I know that what I'm looking for should match. Originally I thought that my ...
Jim's user avatar
  • 10.6k
37 votes
4 answers
12k views

Can you explain the evolution hierarchy of operating systems (Linux and Windows) from Unix?
Renjith G's user avatar
  • 6,008
4 votes
4 answers
21k views

How do I replace the first blank line with two lines of content? I did see a question on replacing multiple blank lines with a single blank line in vim sed but don't quite see how to adapt that. So, ...
Peter Grill's user avatar
  • 1,673
4 votes
6 answers
10k views

I want to add more terminals to the file /etc/securetty. More specifically I would like to add pts/n, where n is in the range 0-9, if it does not exist. Is this possible through sed command? The ...
skrowten_hermit's user avatar
3 votes
8 answers
3k views

Given the string foo-bar, what is a good way to convert it to Foo Bar? Using Bash, OSX.
B Seven's user avatar
  • 8,529
0 votes
1 answer
2k views

I am actually learning about sed command tutorial , where I am running below command in order to print the line 1st,4th,7th,10th,13th ..... line from Notes.txt. I am using MAC terminal sed -n '1~3p' ...
PANKAJ LADE's user avatar
4 votes
1 answer
967 views

I want to use sed to replace two instances of the same digits separated by a slash with one instance of those digits. My input files have lines like this: text (1982/1982) text text (1983/1983) text ...
Big Mac's user avatar
  • 143
1 vote
2 answers
365 views

I wrote a function to get my hosts from ssh config without getting wildcard hosts: sshConfAutoComplete() { cat ~/.ssh/config | \ grep 'host ' | \ sed ' s#.*\*##g; s#host ##g ...
Nickotine's user avatar
  • 554
0 votes
2 answers
147 views

I have an input file with this general structure. I only want to extract the values step and weight from the hill blocks and put them into a output file using awk/sed/grep. Hill blocks are arranged ...
Grayrigel's user avatar
  • 129