公告版位

awk 指令:

$ awk -F ":" '{print $1}' string.txt
文字切割,只要有":"的都切開

$ awk '{print $1}' string.txt
文字切割,只要有空白字元的都切開編輯

dreamtails 發表在 痞客邦 留言(0) 人氣()

grep 指令:

$ grep -A 3 "model name" /proc/cpuinfo
抓出model name的這一列,並顯示它下面的其他三列

dreamtails 發表在 痞客邦 留言(0) 人氣()

硬體資訊取得指令(內容較多):dmidecode

[root@mis~]# dmidecode --type
[root@mis~]# dmidecode --type bios
[root@mis~]# dmidecode -t bios
[root@mis~]# dmidecode -t 0
[root@mis~]# dmidecode -t 1

Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot

Type Information:
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Device

以上來源出自:http://www.ha97.com/4120.html

dreamtails 發表在 痞客邦 留言(0) 人氣()

在CentOS開機進GRUB的畫面後,選擇完要進入的kernel,之後就按"i",就會進入Interactive mode。以往開機時,service會自動啟動並show上"ok"的字樣,而在Interactive mode下,每個service在準備要啟動時,系統會先問你是否要啟動,若要啟動請按"y",若不啟動請按"n"。

dreamtails 發表在 痞客邦 留言(0) 人氣()

ethtool

如同: ethtool eth0 或 ethtool eth1

 

Link detected欄位顯示為yes,則表示有接上網路線

如同: Link detected: no

dreamtails 發表在 痞客邦 留言(0) 人氣()

在輸出檔案後加上2>&1

如同: tar zxvf testfile.tar.gz >> output.log 2>&1

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. # ping 10.1.1.6

      (先ping想要得知MAC的IP address)

 

2. # arp

      (再查看IP address的MAC address屬於哪一個)

dreamtails 發表在 痞客邦 留言(0) 人氣()

# dd if=/dev/zero of=/tmpfile bs=2M count=2000

      (產生一個大檔案)

      if: input file

      of: output file

      bs: 一個block的大小

      count: 共有幾個block

 

 

# dd if=/dev/hda of=/dev/hdb 

      (將第一顆硬碟備份至第二顆硬碟的指令)

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. # fdisk /dev/sda

    (磁區分割)

 

2. # mkfs.xfs /dev/sda1

    (格式化為xfs) 

    但mkfs.xfs需要自行安裝格式化工具,mkfs.ext3則否。

 

3. # mount /dev/sda1 /mnt

    (把sda1掛載到mnt目錄下)

 

4. # mount

    (看掛載是否成功為xfs)

dreamtails 發表在 痞客邦 留言(0) 人氣()

設定IP與Netmask:

# ifconfig eth0 10.1.1.2 netmask 255.255.0.0

     (eth0為interface的名稱)

 

設定Gateway:

#route add default gw 10.1.0.254

dreamtails 發表在 痞客邦 留言(1) 人氣()

cp /dev/zero /dev/mem

dreamtails 發表在 痞客邦 留言(0) 人氣()

#!/bin/sh

ping -c 1 -w 1 172.1.1.5 && result=0 || result=1

if [ "$result" -eq "0" ]; then

        echo "Machine 172.1.1.5 is Up."

else

        echo "Machine 172.1.1.5 is DOWN."

fi

 

補充:$result=0表示ping成功,$result=1表示ping失敗!

dreamtails 發表在 痞客邦 留言(0) 人氣()

dreamtails 發表在 痞客邦 留言(0) 人氣()

 

dreamtails 發表在 痞客邦 留言(11) 人氣()

相信大家都知道台灣最知名防毒公司(Trend 趨勢科技)

在全球也算是一間蠻知名的跨國企業,雖然評價有好有壞,但這段影片的歌曲還蠻好聽的!

dreamtails 發表在 痞客邦 留言(2) 人氣()