`
qindongliang1922
  • 浏览: 2210795 次
  • 性别: Icon_minigender_1
  • 来自: 北京
博客专栏
7265517b-f87e-3137-b62c-5c6e30e26109
证道Lucene4
浏览量:118380
097be4a0-491e-39c0-89ff-3456fadf8262
证道Hadoop
浏览量:126723
41c37529-f6d8-32e4-8563-3b42b2712a50
证道shell编程
浏览量:60767
43832365-bc15-3f5d-b3cd-c9161722a70c
ELK修真
浏览量:71951
社区版块
存档分类
最新评论

shell脚本杂记(五)

阅读更多
1,找出多个文件所占用的磁盘空间 du  f1 f2
[root@master hadoopsys]# du hosts pub.sh 
4       hosts
4       pub.sh
[root@master hadoopsys]# 

默认以字节为单位
显示每个目录的大小du -a dir
[root@master hadoopsys]# du -a hadoopconf/
8       hadoopconf/mapred-queues.xml.template
4       hadoopconf/httpfs-signature.secret
4       hadoopconf/httpfs-env.sh
4       hadoopconf/mapred-env.sh
4       hadoopconf/mapred-site.xml
4       hadoopconf/core-site.xml
4       hadoopconf/yarn-site.xml
4       hadoopconf/yarn-env.sh
4       hadoopconf/hadoop-env.cmd
4       hadoopconf/hadoop-metrics2.properties
4       hadoopconf/mapred-env.cmd
4       hadoopconf/hdfs-site.xml
4       hadoopconf/hadoop-metrics.properties
4       hadoopconf/configuration.xsl
4       hadoopconf/container-executor.cfg
4       hadoopconf/httpfs-site.xml
4       hadoopconf/slaves
12      hadoopconf/log4j.properties
4       hadoopconf/capacity-scheduler.xml
4       hadoopconf/hadoop-env.sh
4       hadoopconf/httpfs-log4j.properties
12      hadoopconf/hadoop-policy.xml
4       hadoopconf/ssl-client.xml.example
4       hadoopconf/ssl-server.xml.example
4       hadoopconf/yarn-env.cmd
124     hadoopconf/
[root@master hadoopsys]# 

单独执行du dir
[root@master hadoopsys]# du hadoopconf/
124     hadoopconf/
[root@master hadoopsys]# 

如果想采用更好的方式显示,可以使用du -h dir
还可以使用du -c来计算所有文件或目录总共占了多少磁盘空间:
[root@master hadoopsys]# du -c pub.sh 
4       pub.sh
4       总用量
[root@master hadoopsys]# 

除此之外,统计还支持过滤:
[root@master hadoopsys]# du -c *.sh
4       begin.sh
4       pub.sh
4       repack.sh
12      总用量
[root@master hadoopsys]# 


通常我们使用du -sh *来显示当前目录相下,文件大小情况:
[root@master hadoopsys]# du -sch *
5.4M    apache-ant-1.9.4-bin.tar.gz
52M     apache-hive-0.13.1-bin.tar.gz
5.0M    apache-maven-3.0.5-bin.tar.gz
4.0K    begin.sh
8.0K    etc
92M     hadoop-2.2.0.tar.gz
124K    hadoopconf
76M     hbase-0.96.2-hadoop2-bin.tar.gz
36K     hbaseconf
4.0K    hosts
92M     jdk-7u25-linux-x64.gz
4.0K    pub.sh
4.0K    repack.sh
16K     zkconf
16M     zookeeper-3.4.5.tar.gz
338M    总用量
[root@master hadoopsys]# 


排除部分文件:
[root@master hadoopsys]# du    --exclude "*.sh"  ./   
4       ./etc
108     ./hadoopconf
28      ./hbaseconf
16      ./zkconf
345132  ./
[root@master hadoopsys]# 


指定深度,统计
du --ma-depth 2 dir
df -h 查看磁盘信息
[root@master hadoopsys]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       9.7G  2.3G  6.9G  25% /
tmpfs           495M     0  495M   0% /dev/shm
/dev/sda1       194M   28M  157M  15% /boot
/dev/sda3       9.9G  889M  8.6G  10% /home
[root@master hadoopsys]#


2,time命令,统计命令脚本耗时
[root@master hadoopsys]# time ls
apache-ant-1.9.4-bin.tar.gz    begin.sh             hadoopconf                       hosts                  repack.sh
apache-hive-0.13.1-bin.tar.gz  etc                  hbase-0.96.2-hadoop2-bin.tar.gz  jdk-7u25-linux-x64.gz  zkconf
apache-maven-3.0.5-bin.tar.gz  hadoop-2.2.0.tar.gz  hbaseconf                        pub.sh                 zookeeper-3.4.5.tar.gz

real    0m0.004s
user    0m0.001s
sys     0m0.003s


3,收集与当前登录用户,启动日志,和启动故障相关的信息
who ,w ,users ,uptime ,last .lastb
[root@master hadoopsys]# who
root     pts/0        2014-09-23 01:48 (192.168.46.24)
root     pts/1        2014-09-23 01:13 (192.168.46.24)
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# w
 03:08:48 up  4:59,  2 users,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    192.168.46.24    01:48    0.00s  0.13s  0.00s w
root     pts/1    192.168.46.24    01:13   37:06   0.03s  0.03s -bash
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# users 
root root
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# uptime 
 03:08:57 up  4:59,  2 users,  load average: 0.00, 0.00, 0.00
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# last
root     pts/0        192.168.46.24    Tue Sep 23 01:48   still logged in   
root     pts/0        192.168.46.24    Tue Sep 23 01:30 - 01:48  (00:17)    
root     pts/0        192.168.46.24    Tue Sep 23 01:17 - 01:30  (00:13)    
root     pts/0        192.168.46.24    Tue Sep 23 01:17 - 01:17  (00:00)    
root     pts/0        192.168.46.24    Tue Sep 23 01:16 - 01:17  (00:00)    
root     pts/1        192.168.46.24    Tue Sep 23 01:13   still logged in   
root     pts/0        192.168.46.24    Tue Sep 23 01:00 - 01:16  (00:15)    
root     pts/0        192.168.46.24    Tue Sep 23 00:59 - 01:00  (00:00)    
dong     pts/1        zk1              Mon Sep 22 22:34 - 22:35  (00:00)    
root     pts/0        192.168.46.24    Mon Sep 22 22:16 - 23:38  (01:21)    
root     tty1                          Mon Sep 22 22:10 - 23:10  (01:00)    
reboot   system boot  2.6.32-431.el6.x Mon Sep 22 22:09 - 03:09  (04:59)    
root     pts/0        192.168.46.19    Wed Jun 11 00:12 - crash (103+21:56) 
root     tty1                          Wed Jun 11 00:12 - crash (103+21:57) 
reboot   system boot  2.6.32-431.el6.x Wed Jun 11 00:12 - 03:09 (104+02:56) 
root     pts/3        192.168.46.16    Fri May 30 17:19 - crash (11+06:53)  
root     pts/2        192.168.46.16    Fri May 30 17:01 - crash (11+07:10)  
root     pts/3        192.168.46.16    Fri May 30 16:19 - 17:19  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 16:01 - 17:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 15:19 - 16:19  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 15:01 - 16:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 14:19 - 15:19  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 14:01 - 15:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 13:18 - 14:18  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 13:01 - 14:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 12:18 - 13:18  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 12:01 - 13:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 11:18 - 12:18  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 11:01 - 12:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 10:18 - 11:18  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 10:01 - 11:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 09:18 - 10:18  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 09:01 - 10:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 08:18 - 09:18  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 08:01 - 09:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 07:18 - 08:18  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 07:01 - 08:01  (01:00)    
root     pts/3        192.168.46.16    Fri May 30 06:18 - 07:18  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 06:01 - 07:01  (01:00)    
root     pts/2        192.168.46.16    Fri May 30 04:26 - 06:00  (01:34)    
root     pts/1        192.168.46.16    Fri May 30 04:00 - crash (11+20:11)  
root     tty1                          Fri May 30 03:59 - 04:59  (01:00)    
root     pts/0        192.168.46.16    Fri May 30 03:52 - 06:18  (02:26)    
root     pts/0        192.168.46.16    Thu May 29 18:34 - 03:48  (09:13)    
reboot   system boot  2.6.32-431.el6.x Thu May 29 18:33 - 03:09 (116+08:35) 
root     pts/3        192.168.46.16    Thu May 29 06:01 - crash  (12:31)    
root     pts/2        192.168.46.16    Thu May 29 05:56 - crash  (12:37)    
root     pts/1        192.168.46.16    Thu May 29 05:56 - crash  (12:37)    
root     pts/0        192.168.46.16    Thu May 29 05:55 - crash  (12:38)    
reboot   system boot  2.6.32-431.el6.x Thu May 29 05:54 - 03:09 (116+21:14) 
root     pts/6        192.168.46.16    Thu May 29 05:48 - down   (00:05)    
root     pts/5        192.168.46.16    Thu May 29 05:46 - down   (00:07)    
root     pts/5        192.168.46.16    Thu May 29 05:46 - 05:46  (00:00)    
root     pts/5        192.168.46.16    Thu May 29 05:41 - 05:46  (00:04)    
root     pts/3        192.168.46.16    Thu May 29 05:39 - down   (00:14)    
root     pts/2        192.168.46.16    Thu May 29 05:38 - down   (00:15)    
root     pts/2        192.168.46.16    Thu May 29 05:37 - 05:38  (00:00)    
root     pts/1        192.168.46.16    Thu May 29 05:37 - down   (00:16)    
root     pts/0        192.168.46.18    Thu May 29 04:43 - down   (01:10)    
root     pts/5        192.168.46.18    Thu May 29 03:42 - 04:43  (01:00)    
(00:03)    
root     pts/4        master           Fri Mar  7 01:16 - down   (00:13)    
root     pts/3        192.168.211.253  Fri Mar  7 01:05 - down   (00:25)    
root     pts/2        localhost        Fri Mar  7 01:04 - down   (00:25)    
root     pts/1        localhost        Fri Mar  7 01:04 - down   (00:25)    
root     pts/0        192.168.211.36   Thu Mar  6 22:46 - down   (02:43)    
root     tty1                          Thu Mar  6 22:46 - down   (02:44)    
reboot   system boot  2.6.32-431.el6.x Thu Mar  6 22:45 - 01:30  (02:44)    
root     tty1                          Thu Mar  6 22:32 - crash  (00:12)    
reboot   system boot  2.6.32-431.el6.x Thu Mar  6 22:32 - 01:30  (02:58)    
root     tty1                          Thu Mar  6 22:05 - crash  (00:26)    
reboot   system boot  2.6.32-431.el6.x Thu Mar  6 22:04 - 01:30  (03:25)    
root     tty1                          Thu Mar  6 21:58 - down   (00:06)    
reboot   system boot  2.6.32-431.el6.x Thu Mar  6 21:58 - 22:04  (00:06)    
root     tty1                          Thu Mar  6 21:53 - crash  (00:04)    
reboot   system boot  2.6.32-431.el6.x Thu Mar  6 21:52 - 22:04  (00:11)    
root     tty1                          Thu Mar  6 21:50 - crash  (00:02)    
reboot   system boot  2.6.32-431.el6.x Thu Mar  6 21:49 - 22:04  (00:14)    

wtmp begins Thu Mar  6 21:49:33 2014
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# 
[root@master hadoopsys]# lastb
root     ssh:notty    192.168.46.18    Thu May 29 03:35 - 03:35  (00:00)    
root     ssh:notty    192.168.75.1     Thu May 29 02:03 - 02:03  (00:00)    
root     ssh:notty    192.168.75.1     Thu May 29 02:03 - 02:03  (00:00)    

btmp begins Thu May 29 02:0


last USER获取最后登录的用户
last reboot最后重启会话信息
lastb 获取失败用户登录会话信息



3,使用watch命令,监控目录情况

[root@master hadoopsys]# watch 'ls -l  | grep "^d" '  
Every 2.0s: ls -l  | grep "^d"                                                                                                                          Tue Sep 23 03:15:59 2014

drwxr-xr-x 2 root root     4096 9月  23 01:02 etc
drwxr-xr-x 2 root root     4096 9月  22 16:58 hadoopconf
drwxr-xr-x 2 root root     4096 9月  22 16:58 hbaseconf
drwxr-xr-x 2 root root     4096 9月  22 16:58 zkconf



默认是2秒,我们也可以指定时间
[root@master hadoopsys]# watch -n 4 'ls -l'
Every 4.0s: ls -l                                                                                                                                       Tue Sep 23 03:18:04 2014

总用量 344992
-rw-r--r-- 1 root root  5564593 6月   9 16:00 apache-ant-1.9.4-bin.tar.gz
-rw-r--r-- 1 root root 54246778 7月  24 17:22 apache-hive-0.13.1-bin.tar.gz
-rw-r--r-- 1 root root  5144659 7月  10 12:50 apache-maven-3.0.5-bin.tar.gz
-rw-r--r-- 1 root root     3693 9月  23 02:18 begin.sh
drwxr-xr-x 2 root root     4096 9月  23 01:02 etc
-rw-r--r-- 1 root root 96183833 6月   9 17:27 hadoop-2.2.0.tar.gz
drwxr-xr-x 2 root root     4096 9月  22 16:58 hadoopconf
-rw-r--r-- 1 root root 79367504 7月  14 10:55 hbase-0.96.2-hadoop2-bin.tar.gz
drwxr-xr-x 2 root root     4096 9月  22 16:58 hbaseconf
-rw-r--r-- 1 root root       42 9月  23 02:07 hosts
-rw-r--r-- 1 root root 96316511 11月 20 2013 jdk-7u25-linux-x64.gz
-rw-r--r-- 1 root root      235 9月  23 02:30 pub.sh
-rw-r--r-- 1 root root       95 9月  23 02:18 repack.sh
drwxr-xr-x 2 root root     4096 9月  22 16:58 zkconf
-rw-r--r-- 1 root root 16402010 6月  12 13:54 zookeeper-3.4.5.tar.gz

突出差异,watch -d 'cmd'
4,使用logrotate来管理日志文件,可以像JAVA里面的log4j一样,滚动生成日志文件,

logrorate的配置目录在/et/logrotate.d里面
我们可以定义一个日志如下所示:
/var/log/yum.log {
    missingok
    notifempty
    size 30k
    yearly
    create 0600 root root
}


下面看下如何向系统日志文件,写入日志信息:
[root@master logrotate.d]# logger  LOG_MESSAGE
[root@master logrotate.d]# logger  你好啊 
[root@master logrotate.d]# tail -n 1 /var/log/messages
Sep 23 03:25:17 master root: 你好啊
[root@master logrotate.d]# 


加一个特定的标记:
[root@master logrotate.d]# logger  -t "==>" 我我我我
[root@master logrotate.d]# tail -n 1 /var/log/messages
Sep 23 03:27:22 master ==>: 我我我我
[root@master logrotate.d]# 


5,查看电源测量:
安装yum install powertop
PowerTOP 2.3      Overview   Idle stats   Frequency stats   Device stats   Tunables                                     

Summary: 5.9 wakeups/second,  0.0 GPU ops/seconds, 0.0 VFS ops/sec and 5.9% CPU use

                Usage       Events/s    Category       Description
             44.7 ms/s      0.00        Process        [khugepaged]
              8.0 ms/s       1.0        Process        powertop
              1.8 ms/s       2.0        Process        [events/0]
              3.1 ms/s       1.0        Process        [kswapd0]
             10.3 µs/s       1.0        Process        [vmmemctl]
              5.5 µs/s       1.0        Process        [flush-8:0]
            464.4 µs/s      0.00        Timer          rh_timer_func
            216.5 µs/s      0.00        Timer          tick_sched_timer
            187.0 µs/s      0.00        Process        sshd: root@pts/0
            137.0 µs/s      0.00        Interrupt      [9] RCU(softirq)
             94.6 µs/s      0.00        Interrupt      [3] net_rx(softirq)
             93.3 µs/s      0.00        Interrupt      [19] eth0
             25.5 µs/s      0.00        Timer          delayed_work_timer_fn
             24.7 µs/s      0.00        Interrupt      [1] timer(softirq)
             22.6 µs/s      0.00        Process        [mpt_poll_0]
             16.8 µs/s      0.00        Timer          hrtimer_wakeup
             16.4 µs/s      0.00        Timer          process_timeout
              9.8 µs/s      0.00        Process        [ksoftirqd/0]
              2.6 µs/s      0.00        Timer          ipmi_timeout
              2.6 µs/s      0.00        Timer          tcp_write_timer









6,监控磁盘的io
使用iotop
iotop -o 显示正在进行的io活动的进程
iotop -b -n 2打印两次统计数据
iotop -p pid 显示需要监视的pid进程的io情况

7,检查磁盘及文件系统错误
fsck /dev/sdb3检查指定的路径
fsck -A 检查所有的文件系统
fsck -a /dev/sda2 自动修复错误
fsck -AN 模拟fsck执行的操作

8,which命令查找某个命令的位置:
[root@master ~]# which  java
/usr/local/jdk/bin/java
[root@master ~]#

9,whereis 命令找出源码的路径,如果有的话:
[root@master ~]# whereis java
java: /etc/java /usr/lib/java /usr/share/java
[root@master ~]# 



10,file命令,来确定文件类型:
[root@master ~]# file bb.sh 
bb.sh: UTF-8 Unicode text
[root@master ~]# 



11,whatis 输出简短的描述信息:
12,kill命令
列出所有信号:
[root@master ~]# kill -l
 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP
 6) SIGABRT      7) SIGBUS       8) SIGFPE       9) SIGKILL     10) SIGUSR1
11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM
16) SIGSTKFLT   17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP
21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU     25) SIGXFSZ
26) SIGVTALRM   27) SIGPROF     28) SIGWINCH    29) SIGIO       30) SIGPWR
31) SIGSYS      34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3
38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7
58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
63) SIGRTMAX-1  64) SIGRTMAX
[root@master ~]# 


kill 9 pid 最常用的终止进程命令
killall 进程名,终止一组相关的进程


13,trap命令,可以捕捉信号,并执行新的命令
14,wall命令,同一个终端广播信息,mesg y 或者mesg n可以禁止或允许写入信息
15,采集系统信息:
[root@master ~]# hostname
master
[root@master ~]# uname -n
master
[root@master ~]# unmae -a
-bash: unmae: command not found
[root@master ~]# uname -a
Linux master 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@master ~]# uname -r
2.6.32-431.el6.x86_64
[root@master ~]# uname -m
x86_64
[root@master ~]# cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
stepping        : 9
cpu MHz         : 3192.789
cache size      : 6144 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dts fsgsbase smep
bogomips        : 6385.57
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

[root@master ~]# cat /proc/meminfo 
MemTotal:        1012352 kB
MemFree:          242180 kB
Buffers:           19320 kB
Cached:           670172 kB
SwapCached:            0 kB
Active:           360848 kB
Inactive:         335756 kB
Active(anon):       7124 kB
Inactive(anon):      212 kB
Active(file):     353724 kB
Inactive(file):   335544 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                16 kB
Writeback:             0 kB
AnonPages:          7128 kB
Mapped:             5132 kB
Shmem:               224 kB
Slab:              57144 kB
SReclaimable:      35492 kB
SUnreclaim:        21652 kB
KernelStack:         592 kB
PageTables:         1308 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      506176 kB
Committed_AS:      48544 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      144700 kB
VmallocChunk:   34359588136 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        8192 kB
DirectMap2M:     1040384 kB
[root@master ~]# cat /proc/partitions 
major minor  #blocks  name

   8        0   20971520 sda
   8        1     204800 sda1
   8        2   10240000 sda2
   8        3   10525696 sda3
[root@master ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000791d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        1301    10240000   83  Linux
/dev/sda3            1301        2611    10525696   83  Linux
[root@master ~]# lshw
-bash: lshw: command not found
[root@master ~]# ls
ls        lsattr    lsblk     lscpu     lsinitrd  lsmod     
[root@master ~]# ls
ls        lsattr    lsblk     lscpu     lsinitrd  lsmod     
[root@master ~]# lscpu 
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 58
Stepping:              9
CPU MHz:               3192.789
BogoMIPS:              6385.57
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
NUMA node0 CPU(s):     0
[root@master ~]#



1
1
分享到:
评论

相关推荐

    win7修复本地系统工具

    win7修复本地系统工具

    《自动化专业英语》04-Automatic-Detection-Block(自动检测模块).ppt

    《自动化专业英语》04-Automatic-Detection-Block(自动检测模块).ppt

    《计算机专业英语》chapter12-Intelligent-Transportation.ppt

    《计算机专业英语》chapter12-Intelligent-Transportation.ppt

    西门子S7-1200博图平台下3轴伺服螺丝机程序解析与应用

    内容概要:本文详细介绍了基于西门子S7-1200博图平台的3轴伺服螺丝机程序。该程序使用SCL语言编写,结合KTP700组态和TIA V14及以上版本,实现了对X、Y、Z三个轴的精密控制。文章首先概述了程序的整体架构,强调了其在自动化控制领域的高参考价值。接着深入探讨了关键代码片段,如轴初始化、运动控制以及主程序的设计思路。此外,还展示了如何通过KTP700组态实现人机交互,并分享了一些实用的操作技巧和技术细节,如状态机设计、HMI交互、异常处理等。 适用人群:从事自动化控制系统开发的技术人员,尤其是对西门子PLC编程感兴趣的工程师。 使用场景及目标:适用于希望深入了解西门子S7-1200博图平台及其SCL语言编程特点的学习者;旨在帮助读者掌握3轴伺服系统的具体实现方法,提高实际项目中的编程能力。 其他说明:文中提供的代码示例和设计理念不仅有助于理解和学习,还能直接应用于类似的实际工程项目中。

    MATLAB仿真:非线性滤波器在水下长基线定位(LBL)系统的应用与比较

    内容概要:本文详细探讨了五种非线性滤波器(卡尔曼滤波(KF)、扩展卡尔曼滤波(EKF)、无迹卡尔曼滤波(UKF)、粒子滤波(PF)和变维卡尔曼滤波(VDKF))在水下长基线定位(LBL)系统中的应用。通过对每种滤波器的具体实现进行MATLAB代码展示,分析了它们在不同条件下的优缺点。例如,KF适用于线性系统但在非线性环境中失效;EKF通过雅可比矩阵线性化处理非线性问题,但在剧烈机动时表现不佳;UKF利用sigma点处理非线性,精度较高但计算量大;PF采用蒙特卡罗方法,鲁棒性强但计算耗时;VDKF能够动态调整状态维度,适合信标数量变化的场景。 适合人群:从事水下机器人(AUV)导航研究的技术人员、研究生以及对非线性滤波感兴趣的科研工作者。 使用场景及目标:①理解各种非线性滤波器的工作原理及其在水下定位中的具体应用;②评估不同滤波器在特定条件下的性能,以便为实际项目选择合适的滤波器;③掌握MATLAB实现非线性滤波器的方法和技术。 其他说明:文中提供了详细的MATLAB代码片段,帮助读者更好地理解和实现这些滤波器。此外,还讨论了数值稳定性问题和一些实用技巧,如Cholesky分解失败的处理方法。

    VMware-workstation-full-14.1.3-9474260

    VMware-workstation-full-14.1.3-9474260

    DeepSeek系列-提示词工程和落地场景.pdf

    DeepSeek系列-提示词工程和落地场景.pdf

    javaSE阶段面试题

    javaSE阶段面试题

    《综合布线施工技术》第5章-综合布线工程测试.ppt

    《综合布线施工技术》第5章-综合布线工程测试.ppt

    安川机器人NX100使用说明书.pdf

    安川机器人NX100使用说明书.pdf

    S7-1200 PLC改造M7120平面磨床电气控制系统:IO分配、梯形图设计及组态画面实现

    内容概要:本文详细介绍了将M7120型平面磨床的传统继电器控制系统升级为基于西门子S7-1200 PLC的自动化控制系统的过程。主要内容涵盖IO分配、梯形图设计和组态画面实现。通过合理的IO分配,确保了系统的可靠性和可维护性;梯形图设计实现了主控制逻辑、砂轮升降控制和报警逻辑等功能;组态画面则提供了友好的人机交互界面,便于操作和监控。此次改造显著提高了设备的自动化水平、运行效率和可靠性,降低了维护成本。 适合人群:从事工业自动化领域的工程师和技术人员,尤其是熟悉PLC编程和控制系统设计的专业人士。 使用场景及目标:适用于需要进行老旧设备升级改造的企业,旨在提高生产设备的自动化水平和可靠性,降低故障率和维护成本。具体应用场景包括但不限于金属加工行业中的平面磨床等设备的控制系统改造。 其他说明:文中还分享了一些实际调试中的经验和技巧,如急停逻辑的设计、信号抖动的处理方法等,有助于读者在类似项目中借鉴和应用。

    chromedriver-linux64-136.0.7103.48.zip

    chromedriver-linux64-136.0.7103.48.zip

    IMG_20250421_180507.jpg

    IMG_20250421_180507.jpg

    《网络营销策划实务》项目一-网络营销策划认知.ppt

    《网络营销策划实务》项目一-网络营销策划认知.ppt

    Lianantech_Security-Vulnerabil_1744433229.zip

    Lianantech_Security-Vulnerabil_1744433229

    MybatisCodeHelperNew2019.1-2023.1-3.4.1.zip

    MybatisCodeHelperNew2019.1-2023.1-3.4.1

    《Approaching(Almost)any machine learning problem》中文版第13章(最后一章)

    【深度学习部署】基于Docker的BERT模型训练与API服务部署:实现代码复用与模型共享

    火车票订票系统设计与实现(代码+数据库+LW)

    摘  要 传统办法管理信息首先需要花费的时间比较多,其次数据出错率比较高,而且对错误的数据进行更改也比较困难,最后,检索数据费事费力。因此,在计算机上安装火车票订票系统软件来发挥其高效地信息处理的作用,可以规范信息管理流程,让管理工作可以系统化和程序化,同时,火车票订票系统的有效运用可以帮助管理人员准确快速地处理信息。 火车票订票系统在对开发工具的选择上也很慎重,为了便于开发实现,选择的开发工具为Eclipse,选择的数据库工具为Mysql。以此搭建开发环境实现火车票订票系统的功能。其中管理员管理用户,新闻公告。 火车票订票系统是一款运用软件开发技术设计实现的应用系统,在信息处理上可以达到快速的目的,不管是针对数据添加,数据维护和统计,以及数据查询等处理要求,火车票订票系统都可以轻松应对。 关键词:火车票订票系统;SpringBoot框架,系统分析,数据库设计

    【ABB机器人】-00标准保养简介.pdf

    【ABB机器人】-00标准保养简介.pdf

    最新校园跑腿小程序源码 多校版本 多模块 适合跑腿 外卖 表白 二手 快递等校园服务.zip

    最新校园跑腿小程序源码 多校版本,多模块,适合跑腿,外卖,表白,二手,快递等校园服务 此版本为独立版本,不需要微擎 直接放入就可以 需要自己准备好后台的服务器,已认证的小程序,备案的域名!

Global site tag (gtag.js) - Google Analytics