linux 内核 libc,linux查看内核 cpu mem gcc libc命令(zz)

查看系统内核版本命令:

uname -a

more /etc/*release more /etc/redhat-release

more /proc/version

[root@localhost ~]# uname -a

Linux localhost.localdomain 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18 :00:54 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost ~]# more /etc/*release

Red Hat Enterprise Linux AS release 4 (Nahant Update 2 )

[root@localhost ~]# more /etc/redhat-release

Red Hat Enterprise Linux AS release 4 (Nahant Update 2 )

[root@localhost ~]# more /etc/issue

Red Hat Enterprise Linux AS release 4 (Nahant Update 2 )

Kernel \r on an \m

[root@localhost ~]# more /proc/version

Linux version 2.6.9-22.ELsmp(bhcompile@crowe.devel.redhat.com)(gcc version 3.4.4 20050721(Red Hat 3.4.4-2 )) #1 SMP Mon Se

p 19 18 :00:54 EDT 2005

查看cpu 信息

grep "model name" /proc/cpuinfo

[root@localhost ~]# grep "model name" /proc/cpuinfo

model name: Dual-Core AMD Opteron(tm) Processor 2216

model name: Dual-Core AMD Opteron(tm) Processor 2216

model name: Dual-Core AMD Opteron(tm) Processor 2216

model name: Dual-Core AMD Opteron(tm) Processor 2216

[root@localhost ~]# more /proc/cpuinfo

processor : 0

vendor_id : AuthenticAMD

cpu family: 15

model : 65

model name: Dual-Core AMD Opteron(tm) Processor 2216

stepping: 2

cpu MHz : 2412.409

cache size: 1024 KB

physical id : 0

siblings: 2

core id : 0

cpu cores : 2

fpu : yes

fpu_exception : yes

cpuid level : 1

wp: yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mcacmov pat pse36 clflush mmx fxsr sse sse2 ht sysca

ll nx mmxext lm 3dnowext 3dnow pni cx16 ts fid vid ttp芬+3

bogomips: 4849.66

TLB size: 1088 4K pages

clflush size: 64

cache_alignment : 64

address sizes : 40 bits physical , 48 bits virtual

power management: ts fid vid ttp [4] [5]

processor : 1

vendor_id : AuthenticAMD

cpu family: 15

model : 65

model name: Dual-Core AMD Opteron(tm) Processor 2216

stepping: 2

cpu MHz : 2412.409

cache size: 1024 KB

physical id : 0

siblings: 2

core id : 1

cpu cores : 2

fpu : yes

fpu_exception : yes

cpuid level : 1

wp: yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mcacmov pat pse36 clflush mmx fxsr sse sse2 ht sysca

ll nx mmxext lm 3dnowext 3dnow pni cx16 ts fid vid ttp芬+3

bogomips: 4816.89

TLB size: 1088 4K pages

clflush size: 64

cache_alignment : 64

address sizes : 40 bits physical , 48 bits virtual

power management: ts fid vid ttp [4] [5]

processor : 2

vendor_id : AuthenticAMD

cpu family: 15

model : 65

model name: Dual-Core AMD Opteron(tm) Processor 2216

stepping: 2

cpu MHz : 2412.409

cache size: 1024 KB

physical id : 1

siblings: 2

core id : 2

cpu cores : 2

fpu : yes

fpu_exception : yes

cpuid level : 1

wp: yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mcacmov pat pse36 clflush mmx fxsr sse sse2 ht sysca

ll nx mmxext lm 3dnowext 3dnow pni cx16 ts fid vid ttp芬+3

bogomips: 4816.89

TLB size: 1088 4K pages

clflush size: 64

cache_alignment : 64

address sizes : 40 bits physical , 48 bits virtual

power management: ts fid vid ttp [4] [5]

processor : 3

vendor_id : AuthenticAMD

cpu family: 15

model : 65

model name: Dual-Core AMD Opteron(tm) Processor 2216

stepping: 2

cpu MHz : 2412.409

cache size: 1024 KB

physical id : 1

siblings: 2

core id : 3

cpu cores : 2

fpu : yes

fpu_exception : yes

cpuid level : 1

wp: yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mcacmov pat pse36 clflush mmx fxsr sse sse2 ht sysca

ll nx mmxext lm 3dnowext 3dnow pni cx16 ts fid vid ttp芬+3

bogomips: 4816.89

TLB size: 1088 4K pages

clflush size: 64

cache_alignment : 64

address sizes : 40 bits physical , 48 bits virtual

power management: ts fid vid ttp [4] [5]

查看cpu 的位数

getconf LONG_BIT

[root@localhost ~]# getconf LONG_BIT

64

[root@localhost ~]# ls /

bin dev home lib lost+found misc opt root selinux sys tftpboot updateusr

boot etc initrd lib64 media mnt proc sbin srv test tmp updates var

要是在root下ls有lib64 文件夹说明系统64

查看libc、gcc 版本

ldd /sbin/mii-tool

rpm -qa | grep glibc

gcc –version

[root@localhost ~]# ldd /sbin/mii-tool

libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a9566c000)

/lib64/ld-linux-x86-64.so.2 (0x0000002a95556000)

[root@localhost ~]# rpm -qa | grep glibc

glibc-2.3.4-2.13

compat-glibc-2.3.2-95.30

glibc-utils-2.3.4-2.13

glibc-common-2.3.4-2.13

glibc-headers-2.3.4-2.13

glibc-devel-2.3.4-2.13

compat-glibc-2.3.2-95.30

glibc-profile-2.3.4-2.13

glibc-2.3.4-2.13

glibc-kernheaders-2.4-9.1.98.EL

compat-glibc-headers-2.3.2-95.30

glibc-devel-2.3.4-2.13

[root@localhost ~]# gcc ——version

gcc (GCC ) 3.4.4 20050721 (Red Hat 3.4.4-2 )

Copyright (C ) 2004 Free Software Foundation, Inc.

This is free software ; see the source for copying conditions. Thereis NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULARPURPOSE.

查看内存信息

more /proc/meminfo

grep MemTotal /proc/meminfo

[root@localhost ~]# more /proc/meminfo

MemTotal: 4045176 kB

MemFree : 2424704 kB

Buffers : 96884 kB

Cached: 1027088 kB

SwapCached: 0 kB

Active: 807884 kB

Inactive: 618432 kB

HighTotal : 0 kB

HighFree: 0 kB

LowTotal: 4045176 kB

LowFree : 2424704 kB

SwapTotal : 2031608 kB

SwapFree: 2031608 kB

Dirty : 24 kB

Writeback : 0 kB

Mapped: 346192 kB

Slab: 170056 kB

Committed_AS: 487688 kB

PageTables: 8492 kB

VmallocTotal: 536870911 kB

VmallocUsed : 1748 kB

VmallocChunk: 536868683 kB

HugePages_Total : 0

HugePages_Free: 0

Hugepagesize: 2048 kB

[root@localhost ~]# grep MemTotal /proc/meminfo

MemTotal: 4045176 kB

使用命令`INFO`可以查看Redis服务器的各种信息,其中包括数据库的数量。在INFO返回的信息中,可以查找键为`"dbX"`(X为数字,表示数据库编号)的信息,每个键对应一个数据库的信息,因此可以统计`"db"`开头的键的数量即可得到数据库的数量。 示例: ``` 127.0.0.1:6379> INFO # Server redis_version:5.0.5 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:b8f43c0d84b2d1c9 redis_mode:standalone os:Linux 4.4.0-18362-Microsoft x86_64 arch_bits:64 multiplexing_api:epoll atomicvar_api:atomic-builtin gcc_version:8.3.0 process_id:12151 run_id:c9df8cd171e8f7b151f72c1d1a2a6ce8987c98d9 tcp_port:6379 uptime_in_seconds:303 uptime_in_days:0 hz:10 configured_hz:10 lru_clock:14220392 executable:/usr/local/bin/redis-server config_file: # Clients connected_clients:1 client_recent_max_input_buffer:2 client_recent_max_output_buffer:0 blocked_clients:0 # Memory used_memory:870368 used_memory_human:850.00K used_memory_rss:9076736 used_memory_rss_human:8.66M used_memory_peak:907264 used_memory_peak_human:886.72K used_memory_peak_perc:95.85% used_memory_overhead:357896 used_memory_startup:784392 used_memory_dataset:512472 used_memory_dataset_perc:70.65% allocator_allocated:1253120 allocator_active:1740800 allocator_resident:10731520 total_system_memory:1073741824 total_system_memory_human:1.00G used_memory_lua:37888 used_memory_lua_human:37.00K used_memory_scripts:0 used_memory_scripts_human:0B number_of_cached_scripts:0 maxmemory:0 maxmemory_human:0B maxmemory_policy:noeviction allocator_frag_ratio:1.39 allocator_frag_bytes:487680 allocator_rss_ratio:6.18 allocator_rss_bytes:8990720 rss_overhead_ratio:0.84 rss_overhead_bytes:-1665024 mem_fragmentation_ratio:11.55 mem_fragmentation_bytes:8206368 mem_not_counted_for_evict:0 mem_replication_backlog:0 mem_clients_slaves:0 mem_clients_normal:0 mem_aof_buffer:0 mem_allocator:libc # Persistence loading:0 rdb_changes_since_last_save:0 rdb_bgsave_in_progress:0 rdb_last_save_time:1604918176 rdb_last_bgsave_status:ok rdb_last_bgsave_time_sec:-1 rdb_current_bgsave_time_sec:-1 rdb_last_cow_size:0 aof_enabled:0 aof_rewrite_in_progress:0 aof_rewrite_scheduled:0 aof_last_rewrite_time_sec:-1 aof_current_rewrite_time_sec:-1 aof_last_bgrewrite_status:ok aof_last_write_status:ok aof_last_cow_size:0 # Stats total_connections_received:3 total_commands_processed:10 instantaneous_ops_per_sec:0 total_net_input_bytes:236 total_net_output_bytes:2305 instantaneous_input_kbps:0.00 instantaneous_output_kbps:0.00 rejected_connections:0 sync_full:0 sync_partial_ok:0 sync_partial_err:0 expired_keys:0 expired_stale_perc:0.00 expired_time_cap_reached_count:0 evicted_keys:0 keyspace_hits:0 keyspace_misses:0 pubsub_channels:0 pubsub_patterns:0 latest_fork_usec:0 migrate_cached_sockets:0 # Replication role:master connected_slaves:0 master_replid:5c5f5d5f5d9d5d5d5d5d5d5d5d5d5d5d5d5d5d5 master_replid2:0000000000000000000000000000000000000000 master_repl_offset:0 second_repl_offset:-1 repl_backlog_active:0 repl_backlog_size:1048576 repl_backlog_first_byte_offset:0 repl_backlog_histlen:0 # CPU used_cpu_sys:0.013000 used_cpu_user:0.010000 used_cpu_sys_children:0.000000 used_cpu_user_children:0.000000 # Cluster cluster_enabled:0 # Keyspace db0:keys=0,expires=0,avg_ttl=0 ``` 在上面的输出中,可以看到`db0`对应的信息,其中`keys`表示该数据库中键的数量。如果有多个数据库,则会有多个`dbX`的信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值