Redirect the piped information in garbage

hello,

i was trying to detect one particular type of file through my script(which is running in loop to detect the file )
so i used the follwing command

ls $PATH/*GLB*|grep CTL  > /dev/null 2>&1

but every time i am getting the message

path/*GLB* not found

i am OK with the file not found message but i do not want this message to be displayed

thanks

ls $PATH/*GLB* 2>/dev/null |grep CTL  > /dev/null 2>&1
1 Like