linux查看java jdk安装路径和设置环境变量
echo $PATH
二:下面是配置linux的环境变量:(记得source .bash_profile) . 修改/etc/profile文件 (全局所有用户)
vi 此文件/etc/profile 在profile文件末尾加入:
vi 此文件/etc/profile
在profile文件末尾加入:
export JAVA_HOME=/usr/share/jdk1.6.0_20
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
.修改.bash_profile文件 (某个用户权限使用这些环境变量)
.bash_profile文件末尾加入:
export JAVA_HOME=/usr/share/jdk1.6.0_20
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
.shell终端执行下列命令: (临时用)
export JAVA_HOME=/usr/share/jdk1.6.0_14
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
三. 卸载jdk ·找到jdk安装目录的_uninst子目录 ·在shell终端执行命令./uninstall.sh即可卸载jdk。
Linux 系统如何查看系统配置信息
一:查看cpu
[root@srv /]# more /proc/cpuinfo | grep "model name"
model name : Intel(R) Xeon(R) CPU X3220 @ .40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ .40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ .40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ .40GHz
[root@srv /]# grep "model name" /proc/cpuinfo
model name : Intel(R) Xeon(R) CPU X3220 @ .40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ .40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ .40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ .40GHz
[root@srv /]# grep "model name" /proc/cpuinfo | cut -f2 -d:
Intel(R) Xeon(R) CPU X3220 @ .40GHz
Intel(R) Xeon(R) CPU X3220 @ .40GHz
Intel(R) Xeon(R) CPU X3220 @ .40GHz
Intel(R) Xeon(R) CPU X3220 @ .40GHz
二:查看内存
[root@srv /]# grep MemTotal /proc/meminfo
MemTotal: kB
[root@srv /]# free -g [root@srv /]# free -m
total used free shared buffers cached
Mem:
-/+ buffers/cache:
Swap:
[root@srv /]# free -m |grep "Mem" | awk '{print $2}'
[root@srv /]#grep MemTotal /proc/meminfo | cut -f2 -d:
614400 kB
(k|K|m|M) 以k|kB|m|MB为单位显示,对应转换(|||) 三:查看CPU位数(32 or 64)
[root@srv /]# getconf LONG_BIT 四:查看linux版本
[root@srv /]# more /etc/redhat-release
CentOS release (Final)
[root@srv /]# more /etc/issue
CentOS release (Final)
Kernel \r on an \m [root@srv /]# more /proc/version
Linux version 2.6.-92.1..el5.028stab060.2PAE ([email=root@rhel5--build-xemul]root@rhel5--build-xemul[/email]) (gc
c version 4.1. (Red Hat 4.1.-)) # SMP Tue Jan :: MSK
五:查看内核版本
[root@srv /]# uname -r
2.6.-92.1..el5.028stab060.2PAE
[root@srv /]# uname -a
Linux srv.eddiechen.cn 2.6.-92.1..el5.028stab060.2PAE # SMP Tue Jan :: MSK i686 i686 i386 GNU/Linux
六:查看时区
[root@srv /]# date -R
Wed, Feb :: +
[root@srv /]# mv /etc/localtime /etc/localtime.save
[root@srv /]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@srv /]# date -R
Wed, Feb :: +
七:主机名
[root@srv /]# hostname
srv.eddiechen.cn
八:查看selinux情况
[root@srv /]# sestatus
SELinux status: disabled
九:网络
IP
[root@srv /]# ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
207.154.202.216
网关
[root@srv /]# cat /etc/sysconfig/network
NETWORKING="yes"
GATEWAY="192.0.2.1"
HOSTNAME="srv.eddiechen.cn"
dns
[root@srv /]# cat /etc/resolv.conf
nameserver 208.74.168.131
nameserver 208.74.168.132
nameserver 4.2.2.1
十:已经安装的软件包
[root@srv /]# rpm -qa | wc -l [root@srv /]# yum list installed | wc -l 十一:磁盘和分区
[root@srv /]# df -h
Filesystem Size Used Avail Use % Mounted on
/dev/simfs 10G 353M .7G % /
[root@srv /]# du -sh
353M
[root@srv /]# du /etc -sh
4.6M /etc