Skip to content
Advertisement

linux ls command to list file with certain characters in filename

I have files with name

JavaScript

in this (_abcd_) remains constant rest of the numbers in beginning and timestamp at the end changes every day. i want to list all such files in a txt file I am doing the following

JavaScript

this will list all files and folder in mypath where I want only file with (abcd) in file name please guide. I Have tried many combinations already

Advertisement

Answer

Use grep to filter the files with abcd like this:

JavaScript

Alternatively, you can use ls only like this:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement