Linux的简单运用

[C:\~]$ ssh 192.168.35.128 远程连接

[root@haha2 ~]# su - xiongzheng  进入普通用户

[xiongzheng@haha2 ~]$ passwd xiongzheng
passwd:只有 root 用户才能指定用户名。

[xiongzheng@haha2 ~]$ exit
注销

[xiongzheng@haha2 ~]$ exit
注销
[root@haha2 ~]# passwd  xiongzheng
更改用户 xiongzheng 的密码 。
新的密码: 
无效的密码: 密码少于 8 个字符
重新输入新的密码: 
[root@haha ~]# hostname haha   临时修改主机名

[root@haha ~]# hostnametcl hostname haha  永久修改主机名

[root@haha2 ~]# hostnametcl  查询主机名是否修改成功

cat查看文件内容

[root@haha2 ~]# cat /etc/shells 查看当前合法的shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
[root@haha2 ~]# echo $SHELL
/bin/bash 查看系统当前使用的shell

[root@haha2 ~]#  /bin/sh
sh-5.1# 切换shell

sh-5.1# exit
exit  退出当前shell

[root@haha2 ~]# pwd
/root 查看当前目录

[root@haha2 ~]# cd /home/  切换home目录

[root@haha2 home]# cd /
[root@haha2 /]# ls /
afs  boot  etc   lib    media  opt   root  sbin  sys  usr
bin  dev   home  lib64  mnt    proc  run   srv   tmp  var     查看根目录

[root@haha2 /]# cd /root
[root@haha2 ~]#  pwd
/root 绝对路径切换到root家目录

[root@haha2 ~]# cd /
[root@haha2 /]# cd root
[root@haha2 ~]# pwd
/root 相对路径切换到root家目录

[root@haha2 ~]# cd .. 切换到当前工作的上一级目录

[root@haha2 /]# cd . 切换到当前目录 


 


 


 


 


 


 

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值