Linux常用命令

mind 

开关机,登入登出

  • reboot 重启
  • init 0
  • init 3
  • init 5
  • exit 退出
  • logout 登出

Shell下修改主机名(/etc/hosts 文件并未修改,有bug)

  • hostnamectl set-hostname master
  • bash

重启网络服务

  • service network restart  重启网络服务( 不行的话 重启 虚拟机, 还不行 重启 vmware, 还不行 重启 电脑 )

防火墙

  • systemctl status firewalld
  • systemctl start firewalld
  • systemctl stop firewalld

常用文件查询命令

  • cat hello.txt | more 
  • cat hello.txt | less  ( less 下 可以用 :/  来 进行关键字查找 )
  • cat hello.txt | grep hello

常用文件追加命令

  • vim hello.txt
  • echo 'abcd' > hello.txt ( cover )
  • echo 'abcd' >> hello.txt

/etc/profile

修改此配置文件后,对所有的用户都生效,如对环境变量的修改

JAVA_HOME = fp

HADOOP_HOME = fp1

HBASE_HOME = fp2

export $PATH = $PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

修改后 需要用 source 刷新一下

yum

yum 是 redhat,centos下的软件安装方式,基于linux,shell前端软件包管理器。

基于rpm包管理,能够从指定的服务器自动下载rpm包并且安装,可以自动处理包的依赖性问题,一次性安装所有所需要的软件依赖包

  • yum list 
  • yum list | grep firefox
  • yum install firefox 

rpm

redhat package manage , 用于  安装,卸载 rpm包 ( redhat, centos 下 的 包资源 管理器 ) 

  • rpm -qa ( query all )
  • rpm -qa | grep firefox
  • rpm -q firefox
  • rpm -ivh firefox ( i = install, v = verbose, h = hash )
  • rpm -e fire fox  ( erase )

rpm  yum 常用于 redhat  centos 下

ubuntu下 用 apt

attention

  • 一般情况下 /etc/ 下的文件的 操作   只读:其他人 , 即 普通用户 ,  读写:  root,root组

设置静态ip(远程登录服务器,需要服务器的稳定的ip不能随意变动)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值