1.查看所有待挂载设备信息

fdisk -l

# fdisk -l

Disk /dev/sda: 120.0 GB,  bytes
heads, sectors/track, cylinders, total sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00002f03 Device Boot Start End Blocks Id System
/dev/sda1 * Linux
/dev/sda2 Extended
/dev/sda5 Linux swap / Solaris Disk /dev/sdb: 1000.2 GB, bytes
heads, sectors/track, cylinders, total sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x3025e656 Device Boot Start End Blocks Id System
/dev/sdb1 HPFS/NTFS/exFAT
/dev/sdb2 HPFS/NTFS/exFAT
/dev/sdb3 HPFS/NTFS/exFAT

2.查看cpu信息

cat /proc/cpuinfo

processor    :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i5- CPU @ .40GHz
stepping :
microcode : 0x19
cpu MHz : 3443.429
cache size : KB
physical id :
siblings :
core id :
cpu cores :
apicid :
initial apicid :
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : 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 rtm
bogomips : 6796.22
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i5- CPU @ .40GHz
stepping :
microcode : 0x19
cpu MHz : 3399.601
cache size : KB
physical id :
siblings :
core id :
cpu cores :
apicid :
initial apicid :
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : 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 rtm
bogomips : 6796.22
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i5- CPU @ .40GHz
stepping :
microcode : 0x19
cpu MHz : 3400.000
cache size : KB
physical id :
siblings :
core id :
cpu cores :
apicid :
initial apicid :
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : 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 rtm
bogomips : 6796.22
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i5- CPU @ .40GHz
stepping :
microcode : 0x19
cpu MHz : 3400.000
cache size : KB
physical id :
siblings :
core id :
cpu cores :
apicid :
initial apicid :
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : 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 rtm
bogomips : 6796.22
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management:

3.查看内存信息

cat /proc/meminfo

cat /proc/meminfo
MemTotal: kB
MemFree: kB
MemAvailable: kB
Buffers: kB
Cached: kB
SwapCached: kB
Active: kB
Inactive: kB
Active(anon): kB
Inactive(anon): kB
Active(file): kB
Inactive(file): kB
Unevictable: kB
Mlocked: kB
HighTotal: kB
HighFree: kB
LowTotal: kB
LowFree: kB
SwapTotal: kB
SwapFree: kB
Dirty: kB
Writeback: kB
AnonPages: kB
Mapped: kB
Shmem: kB
Slab: kB
SReclaimable: kB
SUnreclaim: kB
KernelStack: kB
PageTables: kB
NFS_Unstable: kB
Bounce: kB
WritebackTmp: kB
CommitLimit: kB
Committed_AS: kB
VmallocTotal: kB
VmallocUsed: kB
VmallocChunk: kB
AnonHugePages: kB
HugePages_Total:
HugePages_Free:
HugePages_Rsvd:
HugePages_Surp:
Hugepagesize: kB
DirectMap4k: kB
DirectMap2M: kB

4.硬盘速度测试

hdparm -Tt /dev/sda1

# hdparm -Tt /dev/sda1

/dev/sda1:
Timing cached reads: MB in 2.00 seconds = 11305.77 MB/sec
Timing buffered disk reads: 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 a.m every week with:
# * * tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab() and cron()
#
# 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 a.m every week with:
# * * tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab() and cron()
#
# m h dom mon dow command
*/ * * * * date >> $HOME>test.txt

5.3查看定时任务运行效果

tail -f ~/test.txt

 tail -f ~/test.txt
2015年 10月 02日 星期五 :: CST
2015年 10月 02日 星期五 :: CST
2015年 10月 02日 星期五 :: CST
2015年 10月 02日 星期五 :: 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
~

5.5 开启crontab日志

将cron.*前面的注释符去掉 

. 修改rsyslog(大致是第10行):

sudo vim /etc/rsyslog.d/-default.conf

#cron.*    /var/log/cron.log 

. 重启rsyslog:

sudo  service rsyslog  restart

. 查看crontab日志:

tail -f /var/log/cron.log | nl 

linux常用命令(配置查看,定时任务)的更多相关文章

  1. linux常用命令 、查看日志、web排查

    linux常用命令 ps aux|grep xxx (比如 ps aux|grep tomcat ps aux|grep tomcat-portalvip ps aux|grep nginx 等) r ...

  2. Linux常用命令-文本查看篇

    前言 Linux常用命令中,除了cat还有很多其他用于文本查看的命令.本文将简单介绍一下这些文本查看的命令. 全文本显示--cat cat可能是常用的一个文本查看命令了,使用方法也很简单: cat f ...

  3. Linux常用命令(一)查看日志

    当日志文件存储很大时,需要Linux命令查看: Log 在目录 /var/log/   下 常用命令: tail head grep sed cat tac https://blog.csdn.net ...

  4. Linux常用命令(三)查看当前计算机各方面信息

    1.查看cpu: top 2.查看当前linux版本:name -a 查看当前运行的内核版本:cat /pro/version 查看发行版本信息:cat /etc/issue 查看上面所有信息:lsb ...

  5. Linux常用命令,查看树形结构、删除目录(文件夹)、创建文件、删除文件或目录、复制文件或目录(文件夹)、移动、查看文件内容、权限操作

    5.查看树结构(tree) 通常情况下系统未安装该命令,需要yum install -y tree安装 直接使⽤tree显示深度太多,⼀般会使⽤ -L选项⼿⼯设定⽬录深度 格式:tree -L n [ ...

  6. linux 常用命令(一)——查看硬盘空间-内存-线程的cpu负载-线程内存

    系统参数检查: df -h [enter] 检查硬盘空间 TIP: 使用 man df 可查看该命令使用说明 ; q 退出. free检查内存使用情况: free [enter] TIP: 使用 ma ...

  7. linux 常用命令-配置登陆方式

    使用阿里云服务器,启动实例(ubuntu 7.4,密码登录)后,通过xshell登陆,但是发现xshell中密码登录是灰色禁用的,很惆怅啊,明明设置的就是密码登录,在xshell中找了一通设置发现并没 ...

  8. linux常用命令-4查看文件内容命令

    vi file #打开并浏览文件 grep str /tmp/test #在文件 ‘/tmp/test’ 中查找 “str” grep ^str /tmp/test #在文件 ‘/tmp/test’ ...

  9. 来不及解释!Linux常用命令大全,先收藏再说

    摘要:Linux常用命令,很适合你的. 一提到操作系统,我们首先想到的就是windows和Linux.Windows以直观的可视化的方式操作,特别适合在桌面端PC上操作执行相应的软件.相比较Windo ...

随机推荐

  1. linux 查看系统版本号(转)

    一.查看Linux内核版本命令(两种方法): 1.cat /proc/version [root@localhost ~]# cat /proc/versionLinux version 2.6.18 ...

  2. 架构sass文件

    sass/ | |– base/ | |– _reset.scss # Reset/normalize | |– _typography.scss # Typography rules | ... # ...

  3. 搞定vscode编写java

    下载vscode: 地址: https://code.visualstudio.com/ 安装插件 我这里下载的是绿色版,所以解压后 向桌面发送一个快捷方式 找到VS Code 的快捷方式位置: 右键 ...

  4. BZOJ3622(容斥+dp)

    思路 "恰k个"考虑求至少k.k+1--个容斥 题面说所有数字都不同,可以将所求转化为糖比药多的组数恰为\((n+k)/2\)的方案数 \(f[i][j]\)数组我觉得更好的理解方 ...

  5. 前端JavaScript(3)-关于DOM操作的相关案例,JS中的面向对象、定时器、BOM、位置信息

    小例子: 京东购物车 京东购物车效果: 实现原理: 用2个盒子,就可以完整效果. 先让上面的小盒子向下移动1px,此时就出现了压盖效果.小盒子设置z-index压盖大盒子,将小盒子的下边框去掉,就可以 ...

  6. List和set集合:交集、差集、合集的区别retainAll,removeAll、addAll

    set .list集合的交集(retainAll).差集(removeAll)是没有区别的都是一样的. set .list集合的合集addAll是有区别的:set可以去重复:list不去重复 publ ...

  7. Angular2中实现基于TypeScript的对象合并方法:extend()

    TypeScript里面没有现成的合并对象的方法,这里借鉴jQuery里的$.extend()方法.写了一个TypeScript的对象合并方法,使用方法和jQuery一样. 部分代码和jQuery代码 ...

  8. html5 新增表单控件和表单属性

    新的输入型控件 email:电子邮箱文本框,跟普通的没什么区别 当输入不是邮箱的时候,验证通不过 移动端的键盘会有变化         tel:电话号码 一般用于手机端,是一个键盘切换 url:网页的 ...

  9. Windows下Python多版本共存

    Windows下Python多版本共存 Python数据科学安装Numby,pandas,scipy,matpotlib等(IPython安装pandas) 0.0 因为公司项目,需要Python两个 ...

  10. 安装cadence遇到vcredist.msi找不到问题

    在新装的win7 64位系统上安装cadence遇到了如下问题,最后一个群里面的大哥帮了大忙,解决办法如下: 用windowsinstallercleanup 将KB2467175清理掉再装caden ...