Kāpēc darbojas *. * Saraksts ar visiem failiem un mapēm?

Satura rādītājs:

Kāpēc darbojas *. * Saraksts ar visiem failiem un mapēm?
Kāpēc darbojas *. * Saraksts ar visiem failiem un mapēm?

Video: Kāpēc darbojas *. * Saraksts ar visiem failiem un mapēm?

Video: Kāpēc darbojas *. * Saraksts ar visiem failiem un mapēm?
Video: How to turn your smart lights on automatically when you get home - YouTube 2024, Aprīlis
Anonim
Rīkojoties komandām, dažreiz var rasties negaidīti rezultāti, tādēļ mācīšanās "kāpēc" aiz rezultātiem var būt ļoti interesanta. Paturot to prātā, šodienas SuperUser Q & A ziņai ir atbilde uz ziņkārīgo lasītāja jautājumu.
Rīkojoties komandām, dažreiz var rasties negaidīti rezultāti, tādēļ mācīšanās "kāpēc" aiz rezultātiem var būt ļoti interesanta. Paturot to prātā, šodienas SuperUser Q & A ziņai ir atbilde uz ziņkārīgo lasītāja jautājumu.

Šodienas jautājumu un atbilžu sesija mums priecājas par SuperUser - Stack Exchange dalību, kas ir kopienas vadīta Q & A tīmekļa vietņu grupa.

Jautājums

SuperUser lasītājs Luu Vinh Phuc vēlas uzzināt, kāpēc dir *. * Uzskaitīti visi faili un mapes:

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?

Kāpēc dir *. * Uzskaitīt visus failus un mapes?

Atbilde

SuperUser atbalstītājs Fleet Command ir atbilde mums:

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 “.”.

Vai kaut ko pievienot paskaidrojumam? Skatieties komentāros. Vēlaties lasīt citas atbildes no citiem tehnoloģiju savvy Stack Exchange lietotājiem? Šeit skatiet pilnu diskusiju pavedienu.

Ieteicams: