linux常用命令(配置查看,定时任务)
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常用命令(配置查看,定时任务)的更多相关文章
- linux常用命令 、查看日志、web排查
linux常用命令 ps aux|grep xxx (比如 ps aux|grep tomcat ps aux|grep tomcat-portalvip ps aux|grep nginx 等) r ...
- Linux常用命令-文本查看篇
前言 Linux常用命令中,除了cat还有很多其他用于文本查看的命令.本文将简单介绍一下这些文本查看的命令. 全文本显示--cat cat可能是常用的一个文本查看命令了,使用方法也很简单: cat f ...
- Linux常用命令(一)查看日志
当日志文件存储很大时,需要Linux命令查看: Log 在目录 /var/log/ 下 常用命令: tail head grep sed cat tac https://blog.csdn.net ...
- Linux常用命令(三)查看当前计算机各方面信息
1.查看cpu: top 2.查看当前linux版本:name -a 查看当前运行的内核版本:cat /pro/version 查看发行版本信息:cat /etc/issue 查看上面所有信息:lsb ...
- Linux常用命令,查看树形结构、删除目录(文件夹)、创建文件、删除文件或目录、复制文件或目录(文件夹)、移动、查看文件内容、权限操作
5.查看树结构(tree) 通常情况下系统未安装该命令,需要yum install -y tree安装 直接使⽤tree显示深度太多,⼀般会使⽤ -L选项⼿⼯设定⽬录深度 格式:tree -L n [ ...
- linux 常用命令(一)——查看硬盘空间-内存-线程的cpu负载-线程内存
系统参数检查: df -h [enter] 检查硬盘空间 TIP: 使用 man df 可查看该命令使用说明 ; q 退出. free检查内存使用情况: free [enter] TIP: 使用 ma ...
- linux 常用命令-配置登陆方式
使用阿里云服务器,启动实例(ubuntu 7.4,密码登录)后,通过xshell登陆,但是发现xshell中密码登录是灰色禁用的,很惆怅啊,明明设置的就是密码登录,在xshell中找了一通设置发现并没 ...
- linux常用命令-4查看文件内容命令
vi file #打开并浏览文件 grep str /tmp/test #在文件 ‘/tmp/test’ 中查找 “str” grep ^str /tmp/test #在文件 ‘/tmp/test’ ...
- 来不及解释!Linux常用命令大全,先收藏再说
摘要:Linux常用命令,很适合你的. 一提到操作系统,我们首先想到的就是windows和Linux.Windows以直观的可视化的方式操作,特别适合在桌面端PC上操作执行相应的软件.相比较Windo ...
随机推荐
- day9函数作业详解
1.day9题目 1,整理函数相关知识点,写博客. 2,写函数,检查获取传入列表或元组对象的所有奇数位索引对应的元素,并将其作为新列表返回给调用者. 3,写函数,判断用户传入的对象(字符串.列表.元组 ...
- linux 初始配置(centos)-网络和可视化界面
1. 执行命令查看ip:ip addr 2. 如果没有或取到,要查看网卡是否启动,及ip配置是否正确,请先将ONBOOT改成yes,表示开机即启动 [lobin@localhost ~]$ cat / ...
- idea 添加yuicompressor压缩js/css
打开idea 点击file->Settings 出现如下界面 argumets项填写 : -jar F:\yui\yuicompressor-2.4.8.jar $FilePath$ -o $F ...
- Luogu P3166 [CQOI2014]数三角形 组合数学
好题鸭.. 不好直接求三角形个数,那就用全集-补集,转化为求三点共线的数量. 具体求法是求出水平共线数量与竖直共线数量和斜线共线数量. 用排列组合的知识可知为水平和竖直的为$C_n^3$与$C_m^ ...
- Ocelot实现API网关服务
NET Core微服务之基于Ocelot实现API网关服务 https://www.cnblogs.com/edisonchou/p/api_gateway_ocelot_foundation_01. ...
- HTML——制作一个简易菜单栏
识点写在注释中 <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...
- docker postgresql FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
在docker中启动postgresql时出现错误 FATAL: could not access private key file "/etc/ssl/private/ssl-cert- ...
- java.lang.UnsupportedOperationException: setXIncludeAware is not supported on this JAXP implementation or earlier: class gnu.xml.dom.JAXPFactory的解决办法(图文详解)
不多说,直接上干货! 问题详情 java.lang.UnsupportedOperationException: setXIncludeAware is not supported on this J ...
- 一文读懂DDD
何为DDD DDD不是架构设计方法,不能把每个设计细节具象化,DDD是一套体系,决定了其开放性,体系中可以用任何一种方法来解决这些问题,但是如果一些关键问题没有具体方案落地,可能让团队无所适从. 有的 ...
- Golang 入门系列(十三)用Beego开发web应用
接着之前的内容,前面已经讲过很多Golang的基础语法,mysql的使用,redis的使用,也讲了orm框架,如何创建一个webapi 服务等等,感兴趣的可以看看以前的文章,https://www.c ...