Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This page on Command Line Syntax says I can use something like *.txt to search for a file.

For example, folder Z contains a.txt, b.txt, c.doc, etc.

Now, after I've changed the working directory to Z, what follows next?

It seems that I can't type that straightaway, as this will give me the following:

'*.txt' is not recognized as an internal or external command, operable program or batch file.

How do I go about doing it?

share|improve this question

migrated from Oct 18 '09 at 12:09

This question came from our site for professional and enthusiast programmers.

Please specify an operating system/shell. And even then the question is not really about programming. –  Yuval F Oct 18 '09 at 11:52
What does "sth" mean? Please use English, where possible. –  S.Lott Oct 18 '09 at 11:56
sth means "something" –  Shadi Almosri Oct 18 '09 at 12:09
We guessed as much, but guessing what questions mean shouldn't really be necessary. –  pavium Oct 18 '09 at 13:11

2 Answers 2

Well the wildcard isn't the command :). The command to list the directory contents in the windows console is dir. So you'd have:

dir *.txt
share|improve this answer
ok thanks (15 char) –  yeeen Oct 18 '09 at 11:53
ls if you are on *nix paltform –  Amarghosh Oct 18 '09 at 11:54

The link is explaining that 7-zip does not use DOS style wildcards. For example on a DOS or Windows command shell:

dir *.txt

will list all files ending in txt, and:

dir *.*

will list all files in the folder. On a UNIX/LINUX shell, the equivalent commands are:

ls *.txt


ls *

DOS/Windows files have a 3 character extension, and the . (dot) is used to separate the name from the extension. On Linux and UNIX, there is no extension, but it is common practice to include a . (dot) in the filename followed by one or more characters. On a UNIX system, saying:

ls *.*

will only list files which have a . (dot) in the name.

7Zip uses the Linux/UNIX style of wildcard.

share|improve this answer
Windows files aren't required to have an extension at all - it's just cmd.exe that handles wildcards such as *.* specially. But the filesystem, and almost all applications, have no limits on what the file name can be. (The filesystem itself even accepts | < > ? *, like ext3 does.) –  grawity Oct 18 '09 at 12:22
dir is available on unix too. –  Lee B Oct 18 '09 at 13:11
@grawity, this is almost the opposite of how I understood Windows to work. I've always had the impression that in Windows the type of file is embodied in the extension, and changing it causes dire warnings. Does this mean Windows is becoming more Unix-like? –  pavium Oct 18 '09 at 13:19
Just for the record... The file extension in Windows is a hint as to the file's type, and the registry has default mappings on what to do if you double-click a file, much the same as a .sh in Linux. (Also, the three-character convention is not a rule, and nowadays is often ignored.) Example: try renaming an .html or .xml (or a formatted doc saved as .rtf) file manually to .txt, then double-clicking (or Enter) to open it. Notepad will happily pop up. Doing that with .doc or .exe file will try to show the binary data as text in Notepad, which looks mangled. –  Jon Coombs May 7 at 23:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.