I have this data in file.txt:
1234-abca-dgdsf-kds-2;abc dfsfds 2 123-abcdegfs-sdsd;dsfdsf dfd f 12523-cvjbsvndv-dvd-dvdv;dsfdsfpage
I want
You are missing a slash at the end of the sed command:
sed
Should be "s/-.*;/;/"
"s/-.*;/;/"