You're viewing a comment by Noel Kibai and its responses.

Noel Kibai Permalink
August 27, 2013, 02:42

Explain the following command-lines:
1. sed "s/the/a/g" file
2. sed -n "s/[A-Z]/&/gp" file
3. sed "32,45 s/[()]//g" file
4. sed "/^$/d" file
5. sed "s/\([0-9]\)-\([0-9]\)/\1\2/g" file
6. sed "80q" file

Comment Responses

Vivek Beniwal Permalink
September 06, 2015, 18:44

1. sed "s/the/a/g" file
Replace the with a
2. sed -n "s/[A-Z]/&/gp" file
cat file
3. sed "32,45 s/[()]//g" file
remove ( and ) from line 32 through 45
4. sed "/^$/d" file
delete empty lines
5. sed "s/\([0-9]\)-\([0-9]\)/\1\2/g" file
remove - sign exists between two digits
6. sed "80q" file
print first 80 lines

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "browser_124": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.