linux 问题

来源:互联网 发布:vmware上安装ubuntu 编辑:程序博客网 时间:2024/05/25 16:40
1.PATH中找不到sbin的原因
很奇怪为什么我在root下仍无法在PATH中搜索到sbin下的命令,如/sbin,/usr/sbin,/usr/local/sbin 
翻看/etc/profile: 
if [ "$EUID" = "0" ]; then 
        pathmunge /sbin 
        pathmunge /usr/sbin 
        pathmunge /usr/local/sbin 
fi 
然后echo $EUID,发现确实是0,但是默认情况下仍找不到fdisk等命令 
后来才想起,su root 和su - root的区别就是要不要重新加载配置文件 
如果su - ,那么系统会重新加载/etc/profile,那么就能找到以上路径了 
而如果是普通用户,系统默认是不会加载以上路径到PATH中的

2. 改变启动界面  5:图形界面 3:字符界面
对于redhat: 
vi   /etc/inittab 
把其中一行 
id:5:initdefault: 
改为 
id:3:initdefault: 
即可

3.切换语言版本
  切换英文: LANG="en_US.UTF-8" 或LANG=""
  切换中文: LANG="en_US.UTF-8" 或

             LANG="en_US.UTF-8" SYSFONT="latarcyrheb-sun16" SUPPORTED="zh_CN.UTF-8:zh_CN:zh"

vmstat , sar , iostat ,top都可以,最好的要数top, sar了
rpm -qa |grep  name_of_software 

1.
wget -q -O /dev/null http://192.168.0.34/rss/taobao/rss_taobao.jsp?url=http://www.lafaso.com\&num=5
wget --output-document /var/1 --output-file /var/2 http://192.168.0.34/rss/taobao/rss_taobao.jsp?url=http://www.lafaso.com\&num=6
2.crontab -l  crontab -e
4.scp -r root@192.168.0.22:/usr/share/man/man1/svn*.1.gz /tmp
5.locate find
6.rz  -y     sz 
7.tail -f /usr/local/log/*
8.tail -f /usr/local/resin/log/*  |grep -v "Hibernate:"
如果我们想查看这台服务器设置。 #vi /etc/my.cnf
set-variable=max_user_connections=30 这个就是单用户的连接数
set-variable=max_connections=800 这个是全局的限制连接数
exp ecommerce/ecommerce@erpdb rows=y indexes=y compress=n buffer=65536 feedback=100000 volsize=0 file=p_group_buy.dmp log=you.log tables=p_group_buy
sz p_group_buy.dmp
到目标服务器
rz -y
imp ecommerce/ecommerce@orcl fromuser=ecommerce touser=ecommerce ignore=y rows=y commit=y indexes=y buffer=65536 file=p_group_buy.dmp  


在Linux系统中我一般采用编译源码的方式来安装Apache,有两种方法可以让Apache在系统启动时自动启动。
1. 在/etc/rc.d/rc.local中增加启动apache的命令,例如:/usr/local/httpd/bin/apachectl start
2. 将apache注册为系统服务
首先将apachectl命令拷贝至/etc/rc.d/init.d目录下,改名为apache
使用编辑器打开apache文件,并在第一行#!/bin/sh下增加两行文字如下
# chkconfig: 35 70 30
# description: Apache
接着注册该服务
chkconfig --add apache
一切OK了,启动服务
service apache start
其中所增加的第二行中三个数字第一个表示在运行级别3和5下启动apache,第二、三是关于启动和停止的优先级配置,无关紧要。
Resin注册糸统服务,比较简单:
将Resin脚本复制到/etc/init.d下:
#cp /usr/local/resin/contrib/init.resin /etc/init.d/resin
修改resin脚本权限:
#cd /etc/init.d/
#chmod 755 resin
注册成糸统服务:
chkconifg resin
chkconfig --add resin
chkconfig --level 345 resin on
rpm -qa ***
whereis ***
which ***

原创粉丝点击