Jumat, 25 November 2011

Cara daftar file dengan "dir"

The "dir" command is not new but it remains one of the most useful for average PC users. Perintah "dir" perintah ini tidak baru tetapi tetap salah satu yang paling berguna untuk pengguna PC rata-rata. If you have ever wanted to make a list of all the files contained in a particular folder, you will have discovered that the Windows GUI provides no easy way to do this. Jika Anda pernah ingin membuat daftar semua file yang terkandung dalam folder tertentu, Anda akan telah menemukan bahwa Windows menyediakan GUI ada cara mudah untuk melakukan ini. It is very straightforward, however, when using the command line. Hal ini sangat mudah, namun, ketika menggunakan baris perintah. The command “dir myfolder” will list the files and folders contained in myfolder . Perintah "dir myfolder" akan daftar file dan folder yang terdapat dalam myfolder. Again, there are switches that provide for various modifications of the command. Sekali lagi, ada switch yang menyediakan berbagai modifikasi dari perintah. For example “/h” will show hidden files and “/s” will list the contents of sub-folders in addition to those of the main folder. Sebagai contoh "/ h" akan menampilkan file tersembunyi dan "/ s" akan daftar isi sub-folder selain yang dari folder utama. Of course, the normal output of the command is to the screen. Tentu saja, output normal perintah adalah untuk layar. To output to a file instead of the screen, the command is dir myfolder >listmyfolder.txt where “>” is the redirection symbol. Untuk output ke file bukan dari layar, perintahnya adalah dir myfolder >listmyfolder.txt mana ">" adalah simbol redirection. The file "listmyfolder.txt" will be created by the command. File "listmyfolder.txt" akan dibuat oleh perintah. Output can also be redirected straight to a printer on the LPT1 port but I think it is better to first create a file and then print from there if hardcopy is desired. Output juga dapat diarahkan langsung ke printer pada port LPT1 tapi saya pikir lebih baik untuk pertama kali membuat file dan kemudian cetak dari sana jika hardcopy diinginkan. These lists can be a lot longer than you might think. Daftar ini dapat jauh lebih lama daripada yang Anda kira. (These days most printers are on USB, anyway.) This use of dir is also available in Windows 98/Me. (Hari-hari ini sebagian besar printer berada di USB, anyway.) Penggunaan dir juga tersedia di Windows 98/Me.

The dir command can also be used to list only files with a given extension. Perintah dir juga dapat digunakan untuk membuat daftar file hanya dengan ekstensi tertentu. For example dir myfolder\*.doc /s >listmyfolder.txt will list all Microsoft Word files in myfolder and its subfolders. Sebagai contoh dir myfolder\*.doc /s >listmyfolder.txt akan menampilkan semua file Microsoft Word di myfolder dan subfolder. This form of the command will also list all the directories and sub-directories. Bentuk perintah juga akan daftar semua direktori dan sub-direktori. If you want a list of filenames only, add the switch /b . Jika Anda ingin daftar nama file saja, tambahkan switch / b. The filename will include the full path. Nama file akan mencakup path lengkap.
Renaming files with "ren" Mengganti nama file dengan "ren"

Renaming aa large number of files can be tedious. Mengganti nama aa sejumlah besar file dapat membosankan. The command ren (also written rename ) is somewhat limited but its ability to use wild cards can sometimes be useful. Ren perintah (juga ditulis nama) adalah agak terbatas namun kemampuannya untuk menggunakan kartu liar kadang-kadang bisa berguna. The basic command is ren file1 file2 The renamed file has to stay in the same folder as the original; this command cannot move files to another folder. Perintah dasar adalah ren file1 file2 nama file harus tinggal dalam folder yang sama seperti aslinya, perintah ini tidak dapat memindahkan file ke folder lain. The wildcard capability can be used to change the extension of all files of a certain type. Kemampuan wildcard dapat digunakan untuk mengubah ekstensi dari semua file dari jenis tertentu. Thus ren *.txt *.doc will rename all text files to have a DOC extension. Jadi ren *.txt *.doc akan mengubah nama semua file teks untuk memiliki ekstensi DOC.

Tidak ada komentar:

Posting Komentar

ads