Search for a file from command line

by admin on January 29, 2009

Windows operating system allows users to do lot of things from command line. We can search for files from command prompt itself.

dir /s /b

/s – search in subfolders
/b – prints bare file name,skips file attributes information.

Examples:

Search for a file with the name commandline.txt in d drive.

dir d: commandline.txt /s /b

Search for all the files starting with the string command  and are in current directory including any subfolders.

dir command* /s /b

Search for all files having the string command somewhere in the file name.

dir *command* /s /b

Search for all jpg/jpeg files in c drive.

dir *.jpg *.jpeg /s /b

{ 0 comments… add one now }

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: