1.查看所有待挂载设备信息
fdisk -l
# fdisk -lDisk /dev/sda: 120.0 GB, 120034123776 bytes255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00002f03 Device Boot Start End Blocks Id System/dev/sda1 * 2048 226170879 113084416 83 Linux/dev/sda2 226172926 234440703 4133889 5 Extended/dev/sda5 226172928 234440703 4133888 82 Linux swap / SolarisDisk /dev/sdb: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk identifier: 0x3025e656 Device Boot Start End Blocks Id System/dev/sdb1 2048 614402047 307200000 7 HPFS/NTFS/exFAT/dev/sdb2 614402048 1228802047 307200000 7 HPFS/NTFS/exFAT/dev/sdb3 1228802048 1953519615 362358784 7 HPFS/NTFS/exFAT
2.查看cpu信息
cat /proc/cpuinfo
processor : 0vendor_id : GenuineIntelcpu family : 6model : 60model name : Intel(R) Core(TM) i5-4670 CPU @ 3.40GHzstepping : 3microcode : 0x19cpu MHz : 3443.429cache size : 6144 KBphysical id : 0siblings : 4core id : 0cpu cores : 4apicid : 0initial apicid : 0fdiv_bug : nof00f_bug : nocoma_bug : nofpu : yesfpu_exception : yescpuid level : 13wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtmbogomips : 6796.22clflush size : 64cache_alignment : 64address sizes : 39 bits physical, 48 bits virtualpower management:processor : 1vendor_id : GenuineIntelcpu family : 6model : 60model name : Intel(R) Core(TM) i5-4670 CPU @ 3.40GHzstepping : 3microcode : 0x19cpu MHz : 3399.601cache size : 6144 KBphysical id : 0siblings : 4core id : 1cpu cores : 4apicid : 2initial apicid : 2fdiv_bug : nof00f_bug : nocoma_bug : nofpu : yesfpu_exception : yescpuid level : 13wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtmbogomips : 6796.22clflush size : 64cache_alignment : 64address sizes : 39 bits physical, 48 bits virtualpower management:processor : 2vendor_id : GenuineIntelcpu family : 6model : 60model name : Intel(R) Core(TM) i5-4670 CPU @ 3.40GHzstepping : 3microcode : 0x19cpu MHz : 3400.000cache size : 6144 KBphysical id : 0siblings : 4core id : 2cpu cores : 4apicid : 4initial apicid : 4fdiv_bug : nof00f_bug : nocoma_bug : nofpu : yesfpu_exception : yescpuid level : 13wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtmbogomips : 6796.22clflush size : 64cache_alignment : 64address sizes : 39 bits physical, 48 bits virtualpower management:processor : 3vendor_id : GenuineIntelcpu family : 6model : 60model name : Intel(R) Core(TM) i5-4670 CPU @ 3.40GHzstepping : 3microcode : 0x19cpu MHz : 3400.000cache size : 6144 KBphysical id : 0siblings : 4core id : 3cpu cores : 4apicid : 6initial apicid : 6fdiv_bug : nof00f_bug : nocoma_bug : nofpu : yesfpu_exception : yescpuid level : 13wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtmbogomips : 6796.22clflush size : 64cache_alignment : 64address sizes : 39 bits physical, 48 bits virtualpower management:
3.查看内存信息
cat /proc/meminfo
cat /proc/meminfoMemTotal: 4090736 kBMemFree: 1628156 kBMemAvailable: 2270864 kBBuffers: 7984 kBCached: 991184 kBSwapCached: 0 kBActive: 1458132 kBInactive: 838020 kBActive(anon): 1102336 kBInactive(anon): 377500 kBActive(file): 355796 kBInactive(file): 460520 kBUnevictable: 32 kBMlocked: 32 kBHighTotal: 3227012 kBHighFree: 1084212 kBLowTotal: 863724 kBLowFree: 543944 kBSwapTotal: 4133884 kBSwapFree: 4133884 kBDirty: 308 kBWriteback: 0 kBAnonPages: 1297060 kBMapped: 605736 kBShmem: 182856 kBSlab: 53976 kBSReclaimable: 30016 kBSUnreclaim: 23960 kBKernelStack: 4592 kBPageTables: 16260 kBNFS_Unstable: 0 kBBounce: 0 kBWritebackTmp: 0 kBCommitLimit: 6179252 kBCommitted_AS: 6168352 kBVmallocTotal: 122880 kBVmallocUsed: 52824 kBVmallocChunk: 61204 kBAnonHugePages: 520192 kBHugePages_Total: 0HugePages_Free: 0HugePages_Rsvd: 0HugePages_Surp: 0Hugepagesize: 2048 kBDirectMap4k: 378872 kBDirectMap2M: 530432 kB
4.硬盘速度测试
hdparm -Tt /dev/sda1
# hdparm -Tt /dev/sda1/dev/sda1: Timing cached reads: 22580 MB in 2.00 seconds = 11305.77 MB/sec Timing buffered disk reads: 1094 MB in 3.01 seconds = 363.90 MB/sec
5.cron执行定时任务
crontab -l查看定时任务列表
crontab -e 编辑定时任务
5.1简单的定时任务编辑示范
crontab -e
# Edit this file to introduce tasks to be run by cron.# # Each task to run has to be defined through a single line# indicating with different fields when the task will be run# and what command to run for the task# # To define the time you can provide concrete values for# minute (m), hour (h), day of month (dom), month (mon),# and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system# daemon's notion of time and timezones.# # Output of the crontab jobs (including errors) is sent through# email to the user the crontab file belongs to (unless redirected).# # For example, you can run a backup of all your user accounts# at 5 a.m every week with:# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/# # For more information see the manual pages of crontab(5) and cron(8)# # m h dom mon dow command # ##每隔一分钟输出时间到文件
*/2 * * * * echodate >> $HOME>test.txt
5.2 查看定时任务列表
crontab -l
# crontab -l# Edit this file to introduce tasks to be run by cron.# # Each task to run has to be defined through a single line# indicating with different fields when the task will be run# and what command to run for the task# # To define the time you can provide concrete values for# minute (m), hour (h), day of month (dom), month (mon),# and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system# daemon's notion of time and timezones.# # Output of the crontab jobs (including errors) is sent through# email to the user the crontab file belongs to (unless redirected).# # For example, you can run a backup of all your user accounts# at 5 a.m every week with:# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/# # For more information see the manual pages of crontab(5) and cron(8)# # m h dom mon dow command*/2 * * * * date >> $HOME>test.txt
5.3查看定时任务运行效果
tail -f ~/test.txt
tail -f ~/test.txt2015年 10月 02日 星期五 10:24:01 CST2015年 10月 02日 星期五 10:26:01 CST2015年 10月 02日 星期五 10:28:01 CST2015年 10月 02日 星期五 10:30:01 CST
5.4 crontab补充
5.4.1 开启corntab 服务 /etc/init.d/cron start
5.4.2 开机启动corntab
vim /etc/rc.local 添加需要启动的服务
例如
#!/bin/sh -e## rc.local# # when machine startup, blow scripts will run.## This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0" on success or any other# value on error.## In order to enable or disable this script just change the execution# bits.## By default this script does nothing.export HISTTIMEFORMAT="%Y-%m-%d %H:%i:%S `whoami` " exit 0~
5.5 开启crontab日志
将cron.*前面的注释符去掉 1. 修改rsyslog(大致是第10行):sudo vim /etc/rsyslog.d/50-default.conf#cron.* /var/log/cron.log 2. 重启rsyslog:sudo service rsyslog restart3. 查看crontab日志:tail -f /var/log/cron.log | nl