shell - Why does `rm -i kk kk*` complain about a missing kk? -


well want understand how rm command works,

what tried:

touch kk kk.999 (so creates 2 blank files kk , kk.999) rm -i kk kk* (then tried command deletes kk , try delete files starting kk before deletes kk.999 error occurs) 

my thoughts:

it deletes 'kk' , think linux try delete kk* ('kk' , 'kk.999') kk file left kk.999 (because 'kk' deleted) why says 'kk' didnt found? whoever has linux please try above commands , explain me happening... cant understand. anyway!

the shell expands command line wildcards before command executed. rm -i kk kk* equivalent writing, rm -i kk kk kk.999. second kk causes rm yell file not existing since removed when saw first instance on command line. can write rm -i kk* ensure file names aren't repeated.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -