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. Hive进阶_Hive的子查询

    - 集合中如果含null数据,不可使用not in, 可以使用in- hive只支持where和from子句中的子查询- 主查询和自查询可以不是同一张表 select e.ename from emp ...

  2. kali linux安装搜狗输入法

    1. 更新软件源 vi /etc/apt/sources.list 2. 安装fcitx apt-get install fcitx 3. 下载deb包到指定目录, dpkg -i sogou**** ...

  3. Python网络编程中的服务器架构(负载均衡、单线程、多线程和同步、异步等)

    这篇文章主要介绍服务器架构. 网络服务需要面对两个挑战. 第一个问题是核心挑战,要编写出能够正确处理请求并构造合适响应的代码. 第二个挑战是如何将网络代码部署到随系统自动启动的Windows服务或者是 ...

  4. Ionic开发-常用命令

      $ionic start myApp [tabs | sidemenu | blank] $ionic platform add android $ionic build android $ion ...

  5. list 转换成datatable

    感谢网上的一位朋友 /// <summary> /// 将集合类转换成DataTable /// </summary> /// <param name="lis ...

  6. AnyCAD OpenSource 版本下载和编译

    下载: SVN下载地址:https://anycad.svn.codeplex.com/svn 或者直接下载:http://anycad.codeplex.com/SourceControl/late ...

  7. uvm_reg_predictor——寄存器模型(十七)

    这是寄存器模型类中唯一派生自uvm_component的类,我们的寄存器模式需要实时,以最接近的方式知道DUT中寄存器的变化,uvm_reg_predictor就是为这个而生的. // TITLE: ...

  8. put_user

    1. put_user Name put_user --    Write a simple value into user space. Synopsis put_user ( x, ptr); A ...

  9. 解决ajax 遇到session失效后自动跳转的问题

    在项目中,经常会遇到session失效后,点击任何链接无反应的情况!这样给客户的体验就不是很好,以为是系统出了故障!所以在项目中我们会处理session失效后的跳转问题(一般给用户提示,并跳转后登录页 ...

  10. Python3中requests库学习01(常见请求示例)

    1.请求携带参数的方式1.带数据的post data=字典对象2.带header的post headers=字典对象3.带json的post json=json对象4.带参数的post params= ...