delete lines starting with a pattern

i have a file sample.txt containing

i want to delete lines starting with 123 neglecting spaces and tabs.
but not lines containing 123. i.e.
i want files sample.txt as

help me
thanxx

Try with grep..

grep -v '^[0-9]' inputfile
1 Like
 sed 's/^ *//g;/^123/d' input_file 

--ahamed

1 Like

thnx for reply !

awk '$1!=123' infile

or

awk '$1!="abc"' infile

for text