I want to use grep command to check if [200] after the space exist in this string
https://wwww.example.com/2000/file200.js [200]
https://wwww.example.com/2020/file201.js [404]
I tried to grep "[200]" and grep "\[200\]" but none of them worked.
I need to save the link too after checking with grep so for example it will be something like this
cat links.txt | grep "[200]" > output.txt
the output.txt should contain the links, not the status codes.
Edit: It works with echo but it doesn't work with cat or when I try to give the input from another command.
The command should be like Command | grep "[200]" | cut -d' ' -f1 > New links