linux file based using grep cmd -


i have series of files, example:

abc_dds_20150212_cd.csv abc_dds_20150210_20150212_cd.csv abc_dfg_20150212_20150217_cd.csv 

i want apply grep command in linux can extract first 2 files, not 3rd file ls.

i tried following:

grep -l "" *20150212* -- exclude *20150212_201502* 

you can pipe grep -v:

grep -l "" *20150212* | grep -v "20150212_201502" 

i haven't seen people use grep -l though. using ls seems cleaner solution:

ls -l *20150212* | grep -v "20150212_201502" 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -