Skip to main content
4 of 7
added 251 characters in body
user avatar
user avatar

SOLUTION by SED command

If you want to delete the line containing either '/*' or '*/', here you are:

sed -e '/\*\//d' -e '/\/\*/d' test

You can also save the output by using > and your new file, for instance:

sed -e '/\*\//d' -e '/\/\*/d' test > test2

But if you just want to delete only '/*' and '*/' and not the whole line, you should change the sed command to this one:

sed -e 's/\*\///g' -e 's/\/\*//g' test

SUMMARY

Option '-e command' appends the editing commands specified by the command argument to the list of commands.

's/X//g' will remove the word "X" from lines.

'/X/d' will remove lines containing the word "X"

Good Luck

user172564