วันเสาร์ที่ 13 กุมภาพันธ์ พ.ศ. 2559
วันพุธที่ 13 มกราคม พ.ศ. 2559
Command line : DIR (DOS)
สวัสดีครับ วันนี้ว่าด้วยเรื่อง การดู ไฟล์และ ไดเร็คทอรี่ (โฟร์เดอร์) บทนี้ยาวหน่อยนะครับ นั้นก็คือ คำสั่ง DIR
โดยปกติหากเราเล่นด้วย GUI (Graphical User Interface) หรือ รูปแบบWindows ก็ได้ เวลาเรา้เข้าไปในโฟล์เดอร์ เราจะเห็นโฟล์ในนั้นด้วยรูปลั กษณ์ที่สวยงาม
โดยปกติหากเราเล่นด้วย GUI (Graphical User Interface) หรือ รูปแบบWindows ก็ได้ เวลาเรา้เข้าไปในโฟล์เดอร์
แต่ใน Command Line นั้น หากต้องการให้แสดงต้อง ใช้คำสั่งเพื่อให้ แสดงผลออกมาให้เราเห็น แต่บนความลำบากที่เราต้องพิมพ์ คำสั่งนั้น ยังมีข้อดีอยู่ คือ
คำสั่งนี้สามารถแสดงไฟล์หรื อไดเร็คทรอรี่ที่ถูดตั่งค่า attributes ไว้ได้
ยกตัวอย่างง่ายๆเช่น
DIR
Display a list of files and subfolders
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[:]attribute
/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:S System file /A:-S NOT System file
/A:I Not content indexed Files /A:-I NOT content indexed
/A:L Reparse Point /A:-L NOT Reparse Point (symbolic link)
/A:X No scrub file /A:-X Scrub file (Windows 8+)
/A:V Integrity /A:-V NOT Integrity (Windows 8+)
/A Show all files
Several attributes can be combined e.g. /A:HD-R
[sorted] Sorted by /O[:]sortorder
/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 can 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 years
------------------------------ ------------------------------ ------------------------------ --------------
ก่อนอื่นมารู้ถึงอักขระพิ เศษสำหรับใช้ใน Command line คือ (*)
* Match any characters คือ ทุกตัวอักษร
เช่น เราต้องการหาไฟล์เฉพาะนามสกุล txt เท่านั้น ให้ใช้คำสั่ง
>> dir *.txt
เราต้องการหาไฟล์ ขึ้นต้นด้วย B ตามด้วยทุกตัวอักษรและลงท้ายด้วย1ให้ใช้คำสั่ง
>> dir B*1
------------------------------------------------------------ ------------------------------ -------------
คำสั่งที่อาจจะต้องใช้ประจำ
option /P คือคำสั่งหยุดหน้าจอกรณีที่มี แสดงที่หน้าจอไฟล์มากเกินไป จะหยุดเมื่อแสดงเต็มหน้ าจอและจะแสดงต่อเมื่อกดปุ่มใดๆ
>> dir /P
ให้กดปุ่มใดๆก็ได้เพื่อให้แสดงต่อหากแสดงเกินหน้าก็ยังจะมีขึ้นความ Press any key to continue ต่อ
------------------------------------------------------------ ------------------------------ -------------
dir /w เปลี่ยนรูปแบบแสดง dir เป็นแนวกว้าง
------------------------------------------------------------ ------------------------------ -------------
dir /b แสดงเฉพาะชื่อเท่านั้น ตัดวันเวลา ขนาดไฟล์ และอื่นๆ
------------------------------------------------------------ ------------------------------ -------------
dir /s ใช้แสดงไดเร็คทรอรี่ย่อยทั้ งหมดที่อยู่ใต้ไดเร็คทรอรี่นั้ นๆ พูดง่ายๆคือ โชว์โฟเดอร์ย่อย
ถ้าไปอยู่ใต้ไดร์ C:\ มันจะแสดงทุกๆโฟร์เดอร์ที่มี ในเครื่องครับ
ตัวนี้เวลาจะใช้เหมือนการหาไฟล์ หรือโฟล์เดอร์ที่เราต้องการ และสามารถ ใช้หลาย option ในเวลาเดียวเช่น
ผมต้องการหา โฟร์เดอร์ Backup
C:\Users\hongfong_k>dir backup /s /p /b ความหมายคือ แสดงโฟร์เดอร Backup และค้นหาโฟล์เดอร์ย่อยด้วย ให้หยุดหาเต็มหน้าจอ และแสดงเฉพาะชื่อเท่านั้น
ผลคือทุกโฟร์เดอร์ที่ชื่อตรง Backup จะแสดงพร้อม path
Command line : fc (DOS)
สวัสดีปีใหม่ครับวันนี้มีคำสั่ งที่ไม่ค่อยใช้กันบ่อย
แต่มีประโยชน์มากๆ คือ คำสั่ง
fc ย่อมาจาก file compare (การเปรียบเทียบไฟล์)
Syntax
FC /B pathname1 pathname2
FC [options] pathname1 pathname2
Key
/B : Perform a binary comparison.
options
/C : Do a case insensitive string comparison
/A : Displays only first and last lines for each set of differences.
/U : Compare files as UNICODE text files.
/L : Compares files as ASCII text. (default)
/N : Display line numbers (ASCII only)
/LBn: Limit the number of lines that will be read, "n" sets a maximum number
of consecutive differing lines after which the File Comparison will abort (resync failed)
When FC aborts then "n" number of mismatches will be shown.
default=100 lines.
/nnnn : Specify a number of consecutive lines that must match after a mismatch.
This can be used to prevent the display of the two files from getting
too out of sync
/T : Do not expand tabs to spaces.
/W : Compress white space (tabs and spaces) for comparison.
ด้านบนที่แสดงคือ รูปแบบการใชคำสั่ง และ option นะครับแต่จะยกตัวอย่างแค่ 4 คำสั่ง
ผมสร้างไฟล์ text ไฟล์3ตัว มีfile2 และ file3 ที่เหมือนกัน
คำสั่งที่1 ไม่ใส่option เทียบไฟล์กันตรงๆ ผลลัพท์ออกมาจาได้ดังนี้
> fc file1.txt file2.txt
Comparing files file1.txt and FILE2.TXT
***** file1.txt
Hello
***** FILE2.TXT
hello word
*****
------------------------------ ------------------------------ ---------------------
> fc file3.txt file2.txt
Comparing files file3.txt and FILE2.TXT
FC: no differences encountered
ผลออกมาบอกว่าไม่มีความต่าง
----------------------------- ------------------------------ ----------------------
> fc /b file1.txt file2.txt
Comparing files file1.txt and FILE2.TXT
00000000: 48 68
FC: FILE2.TXT longer than file1.txt
ใส่ option /B (ให้แสดงผลออกเป็นBinary)
ผลออกมาบอกว่าความต่าง
------------------------------ ------------------------------ ---------------------
fc /N file1.txt file2.txt
Comparing files file1.txt and FILE2.TXT
***** file1.txt
1: Hello
***** FILE2.TXT
1: hello word
*****
ใส่ option /N (ให้แสดงผลบรรทัดที่แตกต่างกั นออกมา)
ผลออกมาบอกว่ามีความต่าง
----------------------------- ------------------------------ ----------------------
Command line : type (DOS) และ cat (linux)
วันนี้มีคำสั่งง่ายๆสำหรับใช้ดู ข้อความไฟล์ข้างในที่เป็นข้ อความ หรือ Source code
เช่น นามสกุส txt, bat, sh, log หรืออื่น หากเป็นไฟล์ที่ถูกแปลงเป็ นโปรแกรมจะออกเป็นภาษามนุษย์ต่ างดาวนะครับ
เช่น นามสกุส txt, bat, sh, log หรืออื่น หากเป็นไฟล์ที่ถูกแปลงเป็
นั้นก็คือ TYPE สำหรับ DOS และ cat สำหรับ Linux ดูได้เท่านั้น ไม่สามารถแก้ไข้ได้
วีธีใช้คือ
ไปที่โฟลเดอร์ที่มีไฟล์ที่เราต้ องการดู โดยใช้ คำสั่ง cd เมื่ออยู่ไนโฟลเดอร์ที่เราต้ องการให้พิมพ์
วีธีใช้คือ
ไปที่โฟลเดอร์ที่มีไฟล์ที่เราต้
DOS
> type "ชื่อไฟล์"
หากมีนามสกุลด้วยก็ให้พิมพ์ เช่น
> type "ชื่อไฟล์.นามสกุล"
> type "ชื่อไฟล์"
หากมีนามสกุลด้วยก็ให้พิมพ์ เช่น
> type "ชื่อไฟล์.นามสกุล"
Linux
> cat "ชื่อไฟล์"
หากมีนามสกุลด้วยก็ให้พิมพ์ เช่น
> cat "ชื่อไฟล์.นามสกุล"
หากมีนามสกุลด้วยก็ให้พิมพ์ เช่น
> cat "ชื่อไฟล์.นามสกุล"
ยังสามารถเปิด2ไฟล์พร้อมกัน
> type 1.txt 2.txt
> type 1.txt 2.txt
** ปล Linux ยังมี option เสริม เดียวมาต่อให้ครับ
** ปล Linux ยังมี option เสริม เดียวมาต่อให้ครับ
วันอังคารที่ 12 มกราคม พ.ศ. 2559
Command line : CD
วันนี้มาทำความรู้จักกับคำสั่งสุดจะง่าย
cd หรือ chdir ชื่อเต็มมันก็คือ change directory
ตามชื่อฟังก์ชั่นก็บอกตรงๆเลยนะครับว่าเป็นฟังก์ชั่นการเปลี่ยนที่อยู่ หรือ โฟล์เดอร์
ทั้ง DOS และ Linux จะใช้เหมือนกัน
cd หรือ chdir ชื่อเต็มมันก็คือ change directory
ตามชื่อฟังก์ชั่นก็บอกตรงๆเลยนะครับว่าเป็นฟังก์ชั่นการเปลี่ยนที่อยู่ หรือ โฟล์เดอร์
ทั้ง DOS และ Linux จะใช้เหมือนกัน
*หมายเหตุ คำสั่งบนLinux ต้องใช้เป็นอักษรตัวเล็กทั้งหมดนะครับ
ส่วน DOS สามารถใช้ได้ทั้งตัวอักษรเล็กและตัวอักษรให
ส่วน DOS สามารถใช้ได้ทั้งตัวอักษรเล็กและตัวอักษรให
วันพฤหัสบดีที่ 12 มิถุนายน พ.ศ. 2557
Seagate to Acquire LSI’s Flash Businesses from Avago
Seagate to Acquire LSI’s Flash Businesses from Avago
May 29, 2014 – Seagate Technology plc (NASDAQ: STX), a world leader in storage solutions, and Avago Technologies Limited (NASDAQ: AVGO), a world leading semiconductor device supplier to the enterprise storage, wired, wireless and industrial end markets, today announced that they have entered into a definitive asset purchase agreement under which Seagate will acquire the assets of LSI’s Accelerated Solutions Division (“ASD”) and Flash Components Division (“FCD”) from Avago for $450 million in cash.
The acquisition strengthens Seagate’s strategy to deliver a full suite of storage solutions, providing Seagate with established Enterprise PCIe flash and SSD controller capabilities to deliver solutions for the growing flash storage market. LSI’s ASD business, which is the second largest player in the PCIe flash space, offers a highly differentiated enterprise-grade PCIe flash solution focused on the high-growth cloud and hyperscale markets. LSI’s FCD business, led by its SandForce SF2000 and SF3700 controller products, is driving a multi-product roadmap to address volume markets.
May 29, 2014 – Seagate Technology plc (NASDAQ: STX), a world leader in storage solutions, and Avago Technologies Limited (NASDAQ: AVGO), a world leading semiconductor device supplier to the enterprise storage, wired, wireless and industrial end markets, today announced that they have entered into a definitive asset purchase agreement under which Seagate will acquire the assets of LSI’s Accelerated Solutions Division (“ASD”) and Flash Components Division (“FCD”) from Avago for $450 million in cash.
The acquisition strengthens Seagate’s strategy to deliver a full suite of storage solutions, providing Seagate with established Enterprise PCIe flash and SSD controller capabilities to deliver solutions for the growing flash storage market. LSI’s ASD business, which is the second largest player in the PCIe flash space, offers a highly differentiated enterprise-grade PCIe flash solution focused on the high-growth cloud and hyperscale markets. LSI’s FCD business, led by its SandForce SF2000 and SF3700 controller products, is driving a multi-product roadmap to address volume markets.
สมัครสมาชิก:
บทความ (Atom)
