Category Archives: linux

Centos 查看系统启动时间和运行时间

1.uptime命令 uptime 输出:16:11:40 up 59 days, 4:21, 2 users, load average: 0.00, 0.01, 0.00 如下图所示: 2.查看/proc/uptime文件计算系统启动时间 cat /proc/uptime 输出: 5113396.94... Read More | Share it now!

CentOS 修改IP地址, DNS, 网关

一、CentOS 修改IP地址 修改对应网卡的IP地址的配置文件 # vi /etc/sysconfig/network-scripts/ifcfg-eth0 修改以下内容 DEVICE=eth0 #描述网卡对应的设备别名,例如ifcfg-eth0的文件中它为eth0 BOOTPROTO=static... Read More | Share it now!

Bash Shell中命令行选项/参数处理

0.引言 写程序的时候经常要处理命令行参数,本文描述在Bash下的命令行处理方式。 选项与参数: 如下一个命令行: ./test.sh -f config.conf -v –prefix=/home 我们称-f为选项,它需要一个参数,即config.conf,... Read More | Share it now!

ntp time server

搭建时钟同步服务器 这里选择 cdh1 节点为时钟同步服务器,其他节点为客户端同步时间到该节点。安装ntp: $ yum install ntp 修改 cdh1 上的配置文件 /etc/ntp.conf : restrict default ignore  ... Read More | Share it now!

Linux swap/home/root分区 大小

周氏一族,整理技术文档,给下一代留点教程…… 采用系统默认最下化安装的同学都知道,基本上home的分区大得要命,可现实中,我们home不需要那么大,我们的大部分数据是放在 /... Read More | Share it now!

Linux中查看各文件夹大小命令 estimate file space usage

du -h –max-depth=1 NAME du – estimate file space usage SYNOPSIS du … … EXAMPLES DESCRIPTION Summarize disk usage of each FILE, recursively for directories. Mandatory arguments to long options are mandatory for short options... Read More | Share it now!

Set up CentOS for Hortonworks and Cloudera

https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.0/bk_ambari-installation/content/prepare_the_environment.html   #Network vi /etc/sysconfig/network-scripts/ifcfg-eth0 -> ONBOOT=yes /etc/sysconfig/network-scripts/ifup... Read More | Share it now!

Hostname

The hostname command returns results from DNS and /etc/hosts. hostname is equivilant to uname -n and is the actual “hostname” or “nodename” of the box. All the other hostname arguments use this nodename to look up info. So... Read More | Share it now!

CentOS Linux下VNC Server远程桌面配置详解

PS:偶以前基本不用Linux的远程图形桌面,前几天有开发的同事配置CentOS的vnc有问题,找我解决,就顺便记录总结一下,这个总结是比较完整的。下面的配置在CentOS5.x和6.x、SUSE企业版亲测验证,其他发行版按理也通用: 一、安装相应桌面环境与vnc服务端和客户端: #... Read More | Share it now!