Linux必须熟练掌握的

1)重置Root密码

  1. 重启系统,看到启动倒计时的画面,敲回车
  2. 按‘a’进入[to modify the kernel arguments before booting在启动前修改内核参数]
  3. 进入之后输入‘single’,然后回车
  4. 跳转成功后就可以用passwd指令修改root的密码

2)写备份数据库Shell脚本

3)配置网络

4)配置XShell或者CRT连接

  1. 查看进程
    第一列 root 用户名
    第二列 2192 pid进程号
    最后一列 ssh运行的命令
[root@hadoop-01 ~]# ps -ef | grep ssh
root       2192      1  0 05:21 ?        00:00:00 /usr/sbin/sshd
root       2922   2904  0 05:25 pts/0    00:00:00 grep ssh
  1. 查看端口号
    端口号为22
[root@hadoop-01 ~]# netstat -nlp | grep 2192
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      2192/sshd           
tcp        0      0 :::22                       :::*                        LISTEN      2192/sshd  
  1. 知道端口号查进程【例如重启tomcat】
history | grep ssh
netstat -nlp | grep 22
ps -ef | grep 2192

5)指令目录搜索

  1. find /name “name” 全局搜索
  2. locate Java 搜索Java有关的内容
  3. which Java 搜索Java有关的内容

6)查看命令帮助

  1. man tail 查看tail指令用法
  2. tail --help 查看tail指令用法

7)打印或者追加指令

  1. echo “xxxx” 打印xxxx
  2. echo “xxxx” > test.log 覆盖内容为xxxx
  3. echo “xxxx” >> 追加xxxx

8)tail指令

  1. 监控log日志文件
    退出 ctrl+z
tail -F test.log

一)零碎知识点

  1. wget 下载软件
wget+网址
  1. yum
    下载httpd,不提示y/n
yum -y install httpd
--卸载httd,不要提示用-y
yum -y remove httpd
  1. rpm
--查询http包
rpm -qa | grep http
--卸载http包,后面写全路径,不验证包依赖项(--nodeps),-e(专用(卸载))
rpm -e --nodeps httpd-2.2.15-69.el6.centos.x86_64
  1. tar 压缩 解压
    解压中xzvf解释
    extract files from an archive
    filter the archive through gzip
    verbosely list files processed
    use archive file or device ARCHIVE
--压缩test.log
tar -czf test.tar.gz test.log
--解压  v打印解压后的文件名
tar -xzvf test.tar.gz
  1. mv 移动
    cp test01.log test02.log
--移动文件test.log到文件夹Lee01
mv test.log Lee01
--修改文件名
mv test.log test.log.beifen
  1. 查看磁盘空间 查看内存
df -h
free -m
  1. top
查看机器负载load average
查看哪个进程的CPU memory占的比例比较高
--查看到高的进程,看是否要杀死
ps -ef | grep pid
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值