Skip to content
Advertisement

Tag: glob

linux ls command to list file with certain characters in filename

I have files with name 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 this will list all files and folder in mypath where I want only file with (abcd) in file name please

Exclude directory when grepping with zsh globbing

I have some file structure which contains projects with build folders at various depths. I’m trying to use zsh (extended) globbing to exclude files in build folders. I tried using the following command and many other variants: grep “string” (^build/)# I’m reading this as “Any folder that doesn’t match build 0 or more times.” However I’m still getting results from

Expanding asterisk in glob

I want to be able to print a list of all file in a directory in linux but my code only print out the first item in the directory inside home directory is text1.txt, text2.txt, text3.txt sys.argv[1] should be /home/* when I run it on command line: Script: the output is only the first file in the directory any idea?

Advertisement