Zašto dir *. * Popis svih datoteka i mapa?

Sadržaj:

Zašto dir *. * Popis svih datoteka i mapa?
Zašto dir *. * Popis svih datoteka i mapa?

Video: Zašto dir *. * Popis svih datoteka i mapa?

Video: Zašto dir *. * Popis svih datoteka i mapa?
Video: Using the Essentials in Luminar Neo to Edit a Lighthouse Photo - YouTube 2024, Travanj
Anonim
Ponekad možete završiti s neočekivanim rezultatima prilikom pokretanja naredbi, tako da učenje "zašto" iza rezultata može biti vrlo zanimljivo. Imajući to na umu, današnji SuperUser Q & A post ima odgovor na pitanje čudnog čitatelja.
Ponekad možete završiti s neočekivanim rezultatima prilikom pokretanja naredbi, tako da učenje "zašto" iza rezultata može biti vrlo zanimljivo. Imajući to na umu, današnji SuperUser Q & A post ima odgovor na pitanje čudnog čitatelja.

Današnja pitanja i odgovori nam se javljaju zahvaljujući SuperUseru - podjele Stack Exchange-a, zajednice-driven grupiranja Q & A web stranica.

Pitanje

Čitač SuperUser Luu Vinh Phuc želi znati zašto dir *. * Navodi sve datoteke i mape:

When I run the dir *.* command, it produces unexpected results. Even files and folders without any dot in the name are listed. For example:

Why is that? Is there any way to only list files with a dot?
Why is that? Is there any way to only list files with a dot?

Zašto dir *. * Navodi sve datoteke i mape?

Odgovor

Fleet Command za suradnika SuperUser ima odgovor za nas:

The DIR command comes from a time when:

  • A period (.) was not allowed as a character in file or folder names
  • File and folder names were restricted to 8 characters for names and 3 characters for extensions

Therefore, by that standard, *.* meant whatever the name and whatever the extension. It did not mean a string containing a “.”, which may or may not have characters before or after the “.”.

Microsoft’s policy is preserving backward compatibility, so that interpretation of *.* is retained. But in Windows PowerShell, *.* means a string containing a “.”, which may or may not have characters before or after the “.”.

Imate li nešto za objašnjenje? Zvuči u komentarima. Želite li pročitati više odgovora od drugih tehnoloških korisnika Stack Exchangea? Pogledajte ovdje cijelu raspravu.

Preporučeni: