Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the sed command only remove the number \'2\' and extra spaces in the follo

ID: 3889230 • Letter: U

Question

Using the sed command only remove the number '2' and extra spaces in the following list.

zfs511

   2 zfu534

   2 zfv431

   2 zhz322

   2 ziz179

   2 zjt628

   2 zki628

   2 zkk900

   2 zli781

   2 zmi177

   2 znj398

   2 znz946

zoa511

   2 zph740

   2 zpk794

   2 zpp390

   2 zqk989

   2 zri912

   2 zrm836

zsm005

   2 zsu177

zsw997

   2 zsy086

   2 zti284

   2 ztp029

   2 zua703

   2 zvd629

   2 zvx333

   2 zwl434

   2 zwo292

   2 zwp811

   2 zws426

   2 zxn384

   2 zxz155

   2 zyy294

   2 zzm146

   2 zzn974

Explanation / Answer

Answer is as follows:

We use the sed command as follows:

This will remove all the 2 and extra spaces from the file named file.txt

character s is used to remove multiple item at single time.

In [2 ] there is blank space after 2. Pleease note this..

file.txt is file name. Please use your own file name here.

if there is any query please ask in comments....