Using sed, if there is a space character on a line in a file, I need to print the output with the space character and anything after it removed. Code example:
sed "s/"something here I think"//g' file
So, let’s say a file says this on a line:
Chuck Norris is the man
I just need it to print:
Chuck
Multiple lines applicable too:
Chuck Norris is the man
So is Arnold
Replaced:
Chuck
So
This should do it for you:
To remove from the beginning of the line to the first space, use this: