IZBORNIK HOME FORUM ACCESS EXCEL WORD  
 

HOME

   
1 UVOD
2 CMD sintaksa i XP naredbeni interpreter
3 Parametri i Prekidači
4 Kretanje pomoću tipki
5 Podešavanje prozora
6 Zamjenski znakovi
7 Editiranje TXTdatoteka
8 Posebni simboli u CMD naredbi
9 BATCH datoteke u CMD
10 HELP u CMD prozoru
11 ERROR u CMD prozoru
 

-- NAREDBE U  CMD-u --

  ASSOC
  AT
  ATTRIB
  BREAK
  CACLS
  CALL
  CD
  CHCP
  CHDIR
  CHKDSK
  CHKNTFS
  CLS
  CLIP
  CMD
  COLOR
  COMP
  COMPACT
  CONVERT
  COPY
  DATE
  DEL
  DIR
  DISKCOMP
  DISKCOPY
  DOSKEY
  ECHO
  ENDLOCAL
  ERASE
  EXIT
  FC
  FIND
  FINDSTR
  FOR
  FORMAT
  FTYPE
  GOTO
  GRAFTABL
  HELP
  IF
  LABEL
  MD
  MKDIR
  MODE
  MORE
  MOVE
  PATH
  PAUSE
  POPD
  PRINT
  PROMPT
  PUSHD
  RD
  RECOVER
  REM
  REN
  RENAME
  REPLACE
  RMDIR
  SET
  SETLOCAL
  SHIFT
  SORT
  START
  SUBST
  TIME
  TITLE
  TREE
  TYPE
  VER
  VERIFY
  VOL
  XCOPY
   
   
12 PING
13 IPCONFIG
14 NETSTAT
15 ROUTE
16 NSLOOKUP
17 ARP
18 TRACERT
19 TELNET
20 NET Commands
   
 

Adsense sponzor



NAREDBENO SUČELJE (Command Prompt line)

DIR Search This Web Site

Adsense sponzor



 




DIR

Za pregled sadržaja kazala koristi se naredba dir (eng. directory = folder). Naredbom se može vidjeti koje datoteke i podkazala se nalaze na nekom kazalu. Naredbom dir se

prikazuju se sljedeće informacije :

- veličina datoteke
- naziv i tip datoteke
- datum i vrijeme mijenjanja datoteke
- veličina svih datoteka u folderu
- veličina slobodnog prostora na disku
- broj datoteka i kazala u radnom folderu

 

Na kraju ispisa su prikazani podaci o broju datoteka u kazalu, zauzeću prostora tim datotekama, broj kazala i količinu slobodnog prostora na disku.

Puna sintaksa naredbe dir je sljedeća :
dir [drive:][path][filename] [...] [/p] [/w] [/d] [/a[[:]attributes]][/o[[:]sortorder]]

Parametar Značenje
bez parametera Prikazuje na zaslonu oznaku diskovnog pogona, i sadržaj radnog kazala (uz standardne atribute)
Naredba također prikazuje ukupno zauzeće podataka na disku i slobodan prostor
[drive:][path] Određuje pogon ili kazalo za koje se želi ispis sadržaja
/p Određuje pojedinačnu datoteku ili grupu datoteka koja se želi prikazati. Grupa datoteka se
unosi razdvajanjem s praznim mjestom ili zarezom
/w Prikazuje jednu po jednu stranu na zaslonu. Za narednu stranu treba pritisnuti bilo koju tipku
/d Prikazuje ispis u širokom formatu s više naziva u jednom redu
/a[[:] attributes] Isto kao i /w osim što su datoteke sortirane po stupcu
/o:sortorder Prikazuje samo one datoteke i kazala koja imaju zadane atribute. Ako se ova opcija izostavi naredba
dir prikazuje sva imena osim skrivenih i sistemskih datoteka. Ako se ta opcija bez navođenja atributa tada dir prikazuje sve datoteke uključivši skrivene i sistemske.

Redosljed sortiranja - /o:sortorder

Naredba dir posjeduje mogućnosti sortiranja ispisa na zaslonu. Atributi koji slijede iza parametra [/o:] ukazuju na željeni redoslijed sortiranja. Bez navođenje parametra sortiranja naredba dir prikazuje imena kazala sortiranih u abecednom redu, a onda i imena datoteka sortiranih u istom redoslijedu.

Parametar Značenje
n abecedni redosljed po imenu
e abecedni redosljed po nastavku
d po datumu i vremenu počevši od najmanjeg
s po veličini počevši od najmanjeg
g s kazalima na početku
-n u obrnutom abecednom redoslijedu po imenu
-e u obrnutom abecednom redoslijedu po nastanku
-d po datumu i vremenu, počevši od posljednjeg
-s po veličini, počevši od najvećeg
-g s kazalima na kraju popisa

Osim toga interesantno je ponekad ograničiti prikaz datoteka s određenim atributima ili svojstvima. parametar [/a:]. Njihovo je značenje opisano u sljedećoj tablici 

attribut Značenje
h skrivene datoteke (hiden)
s sistemske datoteke (system)
d folder
a arhivska datoteka
r samo za čitanje (read only)
-h datoteke koje nisu skrivene
-s datoteke koje nisu sistemske
-d samo datoteke
-r datoteke koje nisu samo za čitanje

Primjer 1: Prikaži sadržaj svih kazala uključivši i njihova podkazal na disku C:\, s folderima na početku ispisa
C:\>dir /t:s /o:g

Primjer 2: Prikaži na zaslonu sadržaj kazala c:\winnt ali samo za one datoteke koje su read only i to po abecedi u obrnutom redosljedu nasatavka.
C:\>dir c:\winnt\ /a:r /s:-e

Primjer 3: Prikaži na zaslonu u širokom pregledu nazive svih tekstualnih datoteka na radnom kazalu, počevši od najmanje
C:\>dir *.txt /w /s:s


Displays a list of a directory's files and subdirectories. Used without parameters, dir displays the disk's volume label and serial number, followed by a list of directories and files on the disk, including their names and the date and time each was last modified. For files, dir displays the name extension and the size in bytes. Dir also displays the total number of files and directories listed, their cumulative size, and the free space (in bytes) remaining on the disk.

Syntax

dir [Drive:][Path][FileName] [...] [/p] [/q] [/w] [/d] [/a[[:]attributes]][/o[[:]SortOrder]] [/t[[:]TimeField]] [/s] [/b] [/l] [/n] [/x] [/c] [/4]

Parameters

[Drive:][Path]

Specifies the drive and directory for which you want to see a listing.

[FileName]

Specifies a particular file or group of files for which you want to see a listing.

/p

Displays one screen of the listing at a time. To see the next screen, press any key on the keyboard.

/q

Displays file ownership information.

/w

Displays the listing in wide format, with as many as five file names or directory names on each line.

/d

Same as /w but files are sorted by column.

/a [[:] attributes]

Displays only the names of those directories and files with the attributes you specify. If you omit /a, dir displays the names of all files except hidden and system files. If you use /a without specifying attributes, dir displays the names of all files, including hidden and system files. The following list describes each of the values you can use for attributes. The colon (:) is optional. Use any combination of these values, and do not separate the values with spaces.

Value

Description

h

Hidden files

s

System files

d

Directories

a

Files ready for archiving

r

Read-only files

-h

Files that are not hidden

-s

Files other than system files

-d

Files only (not directories)

-a

Files that have not changed since the last backup

-r

Files that are not read-only

/o [[:]SortOrder]

Controls the order in which dir sorts and displays directory names and file names. If you omit /o, dir displays the names in the order in which they occur in the directory. If you use /o without specifying SortOrder, dir displays the names of the directories, sorted in alphabetic order, and then displays the names of files, sorted in alphabetic order. The colon (:) is optional. The following list describes each of the values you can use for SortOrder. Use any combination of the values, and do not separate these values with white spaces.

Value

Description

n

In alphabetic order by name

e

In alphabetic order by extension

d

By date and time, earliest first

s

By size, smallest first

g

With directories grouped before files

-n

In reverse alphabetic order by name (Z through A)

-e

In reverse alphabetic order by extension (.ZZZ through .AAA)

-d

By date and time, latest first

-s

By size, largest first

-g

With directories grouped after files

/t [[:]TimeField]

Specifies which time field to display or use for sorting. The following list describes each of the values you can use for TimeField.

Value

Description

c

Creation

a

Last access

w

Last written

/s

Lists every occurrence, in the specified directory and all subdirectories, of the specified file name.

/b

Lists each directory name or file name, one per line, including the file name extension. /b does not display heading information or a summary. /b overrides /w.

/l

Displays unsorted directory names and file names in lowercase. /l does not convert extended characters to lowercase.

/n

Displays a long list format with file names on the far right of the screen.

/x

Displays the short names generated for files on NTFS and FAT volumes. The display is the same as the display for /n, but short names are displayed after the long name.

/c

Displays the thousand separator in file sizes.

/4

Displays four-digit year format.

/?

Displays help at the command prompt.

Remarks

  • Using multiple filenames

You can use multiple filenames. Separate file names with spaces, commas, or semicolons. You can use wildcard characters (that is, ? and *) in FileName to display a group of files.

  • Using wildcards

You can use wildcards (that is, ? and *) to display a list of a subset of files and subdirectories.

  • Specifying file display attributes

If you use /a with more than one value in attributes, dir displays the names of only those files with all the specified attributes. For example, if you use /a with r and -h for attributes by using either /a:r-h or /ar-h, dir displays only the names of read-only files that are not hidden.

  • Specifying file name sorting

If you specify more than one SortOrder value, dir sorts the file names by the first criterion first, then by the second criterion, and so on. For example, if you use /o with the e and -s values for SortOrder by using either /o:e-s or /oe-s, dir sorts the names of directories and files by extension, with the largest first, and then displays the final result. The alphabetic sorting by extension causes file names with no extensions to appear first, then directory names, and then file names with extensions.

  • Using redirection symbols and pipes

When you use a redirection symbol (>) to send dir output to a file or a pipe (|) to send dir output to another command, use /a:-d and /b to list the file names only. You can use FileName with /b and /s to specify that dir is to search the current directory and its subdirectories for all file names that match FileName. Dir lists only the drive letter, directory name, file name, and file name extension, one path per line, for each file name it finds. Before you use a pipe for redirection, you should set the TEMP environment variable in your Autoexec.nt file.

  • Presetting dir parameters

You can preset dir parameters by including set with the DIRCMD environment variable in your Autoexec.nt file. You can use any valid combination of dir parameters with set dircmd, including the location and name of a file.

For example, to use the DIRCMD environment variable to set the wide display format (that is, /w) as the default format, type the following command in your Autoexec.nt file:

set dircmd=/w

For a single use of the dir command, you can override a parameter by using the DIRCMD environment variable. To do so, type the parameter that you want to override at the dir command prompt, preceding the parameter with a minus sign. For example:

dir /-w

To change the DIRCMD default settings, type:

set=NewParameter

The new default settings are effective for all subsequent dir commands until you use set dircmd again or until you restart your computer.

To clear all default settings, type:

set dircmd=

To view the current settings of the DIRCMD environment variable, type:

set

Set displays a list of environment variables and their settings. For more information about setting environment variables, see Related Topics.

  • The dir command, with different parameters, is available from the Recovery Console.

Examples

To display all directories, one after the other, in alphabetical order, in wide format and pausing after each screen, make sure that the root directory is the current directory, and then type:

dir /s/w/o/p

Dir lists the name of the root directory, the names of the subdirectories of the root directory, and the names of the files in the root directory, including extensions. Then, dir lists the subdirectory names and file names in each subdirectory in the tree.

To alter the preceding example so that dir displays the file names and extensions, but omits the directory names, type:

dir /s/w/o/p/a:-d

To print a directory listing, type:

ir > prn

When you specify prn, the directory list is sent to the printer attached to the LPT1 port. If your printer is attached to a different port, you must replace prn with the name of the correct port.

You can also redirect output of the dir command to a file by replacing prn with a file name. You can also type a path. For example, to direct dir output to the file Dir.doc in the Records directory, type:

dir > \records\dir.doc

If Dir.doc does not exist, dir creates it, unless the Records directory does not exist. In that case, the following message appears:

File creation error

To display a list of all the file names with the .txt extension in all directories on drive C, type:

dir c:\*.txt /w/o/s/p

Dir displays, in wide format, an alphabetized list of the matching file names in each directory and pauses each time the screen fills up, until you press a key to continue.

Popis svih mapa i podmapa u nekom direktoriju

Syntax
DIR [pathname(s)] [display_format] [file_attributes] [sorted] [time] [options]

Key
[pathname] The drive, folder, and/or files to display,
this can include wildcards:
* Match any characters
? Match any ONE character

[display_format]
/P Pause after each screen of data.
/W Wide List format, sorted horizontally.
/D Wide List format, sorted by vertical column.

[file_attributes] /A:

/A:D Folder /A:-D NOT Folder
/A:R Read-only /A:-R NOT Read-only
/A:H Hidden /A:-H NOT Hidden
/A:A Archive /A:-A NOT Archive
/A Show all files
Several attributes may be combined e.g. /A:HD-R

[sorted] Sorted by /O:

/O:N Name /O:-N Name
/O:S file Size /O:-S file Size
/O:E file Extension /O:-E file Extension
/O:D Date & time /O:-D Date & time
/O:G Group folders first /O:-G Group folders last
several attributes may be combined e.g. /O:GEN

[time] /T: the time field to display & use for sorting

/T:C Creation
/T:A Last Access
/T:W Last Written (default)

[options]
/S include all subfolders.
/R Display alternate data streams. (Vista and above)
/B Bare format (no heading, file sizes or summary).
/L use Lowercase.
/Q Display the owner of the file.

/N long list format where filenames are on the far right.
/X As for /N but with the short filenames included.

/C Include thousand separator in file sizes.
/-C Don’t include thousand separator in file sizes.

/4 Display four-digit year

Primjer 1: Za popis i sortiranje svih foldera po abecednom redu
C:>dir /b | sort > popis.txt

Primjer 2: Za popis i sortiranje svih foldera i datoteka po abecednom redu
C:>dir /b/s | sort > popis.txt

Primjer 3: Za popis i sortiranje svih datoteka po abecednom redu
C:>dir /s | sort > popis.txt

datoteka popis.txt nalazit će se u istom folderu u kojem ste pozicionirani

Adsense sponzor



 




Copyright 2009-2017 - IvanC - ic.ims.hr