日期:2014-05-16  浏览次数:20673 次

linux日记(二)

?

1.查看系统的所用命令

终端中 连着按2下exc键 退出按q

2. more/cat/head/tail ?filename 查看文件

3. find /etc -name *.local 查找文件

4.whereis ls ?查找ls在那啊

5. echo $JAVA_HOME 查看环境变量

6.ln file1 file2 (硬)链接 改变一个文件内容 另一个也变

7.ln -s file1 file2 (软)链接 改变一个文件内容 另一个也变 类似与快捷方式

删除file1 file2也没

8.useradd username 添加用户

可以在home中看到

9.passwd username 为用户设置密码


10.chmod +x file 加上可执行权限

chmod -x file 去掉可执行权限

chmod u+x file 为当前用户加上可执行权限

chmod 755 file 数字对比二进制 给权限

chown usrname file 文件的所有者

11.grep boy file查文本文件哪一行包含我查的字符

?12.ps -ef | grep tomcat 查看tomcat进程

13.kill (-9) 进程id 杀掉进程

14.service iptables stop关闭防火墙

15.wget http://localhost:8080命令行上网

16.rpm -qa 查看所有安装的rpm文件

rpm -e ?包名 ?卸载软件

rpm -ivh filename 安装软件