CentOS linux 常用命令
来源:互联网 发布:淘宝沙发椅子图片 编辑:程序博客网 时间:2024/06/02 05:54
//查看cpu
more /proc/cpuinfo | grep "model name"
grep "model name" /proc/cpuinfo
如果觉得需要看的更加舒服
grep "model name" /proc/cpuinfo | cut -f2 -d:
//查看内存
grep MemTotal /proc/meminfo
grep MemTotal /proc/meminfo | cut -f2 -d:
free -m |grep “Mem” | awk ‘{print $2}’
//查看cpu是32位还是64位
getconf LONG_BIT
//查看当前linux的版本
more /etc/redhat-release
cat /etc/redhat-release
//查看内核版本
uname -r
uname -a
//查看当前时间
date
//查看硬盘和分区
df -h
//也可以查看分区
fdisk -l
//可以看到全部占用的空间
du -sh
//可以看到这个目录的大小
du /etc -sh
//查看安装的软件包
//查看系统安装的时候装的软件包
cat -n /root/install.log 软件包有哪些
more /root/install.log | wc -l 软件包个数
//查看现在已经安装了那些软件包
rpm -qa
rpm -qa | wc -l
yum list installed | wc -l
不过很奇怪,我通过rpm,和yum这两种方式查询的安装软件包,数量并不一样。没有找到原因。
//查看键盘布局
cat /etc/sysconfig/keyboard
cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=
//查看selinux情况
sestatus
sestatus | cut -f2 -d:
cat /etc/sysconfig/selinux
//关闭selinux
cat /etc/sysconfig/selinux
将SELINUX=enforcing改为SELINUX=disable
reboot
//查看ip,mac地址
//在ifcfg-eth0 文件里你可以看到mac,网关等信息。
ifconfig
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut -f2 -d=
ifconfig eth0 |grep “inet addr:” |awk ‘{print $2}’|cut -c 6-
ifconfig | grep ‘inet addr:’| grep -v ‘127.0.0.1′ | cut -d: -f2 | awk ‘{ print $1}’
//查看网关
cat /etc/sysconfig/network
//查看dns
cat /etc/resolv.conf
//查看默认语言
echo $LANG $LANGUAGE
cat /etc/sysconfig/i18n
//查看所属时区和是否使用UTC时间
cat /etc/sysconfig/clock
//查看主机名
hostname
cat /etc/sysconfig/network
//修改主机名就是修改这个文件,同时最好也把/etc/hosts文件也修改。
# du -sh # 查看指定目录的大小
# uptime # 查看系统运行时间、用户数、负载
# cat /proc/loadavg # 查看系统负载
# iptables -L # 查看防火墙设置
# vi /etc/sysconfig/iptables #修改防火墙配置
service iptables status/restart/stop
# route -n # 查看路由表
#/etc/services#固定端口
#nmap -sT localhost#查看本地服务端口
# netstat -lntp # 查看所有监听端口
# netstat -antp # 查看所有已经建立的连接
# netstat -s # 查看网络统计信息
#su - oracle#切换到oracle用户登录
# w # 查看活动用户
# id # 查看指定用户信息
# last # 查看用户登录日志
# cut -d: -f1 /etc/passwd # 查看系统所有用户
# cut -d: -f1 /etc/group # 查看系统所有组
# crontab -l # 查看当前用户的计划任务
# chkconfig --list # 列出所有系统服务
# chkconfig --list | grep on # 列出所有启动的系统服务
#yum update#安装更新
#yum grouplist#安装表
#yum groupinstall "安装的东西"#安装某一软件包
比如用源码包安装gaim 的
#./configure --prefix=/opt/gaim
#make
#make install
如果安装mlterm
#./configure --prefix=/opt/mlterm
#make
#make install
把源码包安装的软件,都指定安装在 /opt目录中,这样不就知道了;
如果删除,就删除相应的软件目录;
有些软件要在解压安装目录中执行 make uninstall ,这样就卸载掉了。
1、CPU使用率:top
2、内存占用率:free
3、磁盘使用率:df -h
4、系统日志:/var/log/,默认日志都放在这个位置
相关命令:last命令,显示最近登陆系统的用户
相关守护进程:SYSLOGD(system log daemon,你可以通过ps -aux | grep syslog查看到,该守护进程处于运行状态),
配置文件位于/etc/syslog.conf
- Linux/CentOS 常用命令集
- Linux/CentOS 常用命令
- CentOS linux 常用命令
- Linux(CentOS)常用命令
- linux(centos) 常用命令
- linux-centos常用命令
- Linux(CentOS)常用命令
- Centos 常用命令(Linux)
- Linux(CentOS)常用命令
- linux centos 常用命令
- linux centos常用命令
- Linux常用命令CentOS
- Linux CentOS 7 常用命令
- <Linux>CentOS常用命令
- CentOS Linux 6.8 常用命令
- Linux学习-Centos 常用命令整理
- centos linux下的常用命令
- 使用centos(linux)命令行常用命令
- ControlTemplate in WPF —— TextBox
- static用法小结
- ControlTemplate in WPF —— RadioButton
- JTextPane(JEditorPane) 的超链接事件监听(HyperlinkListener)
- Android动画学习笔记
- CentOS linux 常用命令
- usaco 4.3 Street Race(搜索)
- js Function.call
- ControlTemplate in WPF —— ListBox
- eclipse 下导入android项目中文乱码
- 中文截取,支持gb2312,gbk,utf-8,big5
- 关于const修饰符(内容不断扩充中)
- Spring源码解析-BeanDefinition在IOC容器中的注册(三)
- ControlTemplate in WPF —— ItemsControl