Find the name which has specific extension in linux using grep
With this command you can extract all css
files present in your provided sample text/code,
grep -o \/[\-a-zA-Z.0-9]*\.css? sample.txt |tr -d '/?'
Here is the explanations of above command,
grep -o \/[\-a-zA-Z.0-9]*\.css? sample.txt
grep
command you will extracting string between /
and .css?
tr -d '/?'
tr
command here will omits unwanted characters from output such as /
and ?
.
Here is the output from my console,