Basic Linux Commands (Beginners)

LInux Command Encyclopedia (Super Detailed Oh!!)

1. Simple system commands.

insert image description here

# 查看ip地址
  ip a(中间的空格任意数量,看心情,嘿嘿)
  ip  addr 
# ping 网络(测试网络是否连通)
  ip 目标机器的ip
# 查看系统时间
  date
# 注销
  logout
# 关机
  shutdown now
# 重启
  reboot
# 清屏
  clear
  ctrl + l

Linux file system

  • core

    1. Everything in Linux is a file
    2. As long as there is a top-level directory, Linux will not be divided into C drive, D drive, etc. like Windows
  • Directory Structure
    insert image description here

  • file meaning

insert image description here

3. File management commands

Note : The command area needs to be case sensitive! ! ! ! ! ! !

#  查看文件列表
  ls[-参数1参数2] [目标文件夹]
# 查看当前目录下的文件列表
  ls
# 查看指定目录下的文件
  ls /
# 查看详细信息,数据信息(用户,,大学,时间,权限信息,文件类型)
  ls -l
# 查看隐藏文件
  ls -a
# 参数并用
  ls - la
# 切换目录
  cd 目标文件夹
# 绝对路径切换
  cd    绝对路径
# 相对路径切换
  cd    相对路径
# 查看当前命令所在的目录
  pwd
# 特殊目录符号
  ~ 当前用户的home目录
  . 当前目录
  .. 上一级目录
# 新建文件夹及文件
  mkdir 文件夹名
# 在指定目录位置,创建文件夹
  mkdir -p /a/b/文件夹名
# 在当前目录下新建文件
  touch 文件名
# 删除文件
  rm 文件
# 删除文件夹
  rm -r 文件夹
# 强制删除不询问
  rm -rf 文件
# 移动文件或修改文件名
  mv 文件 文件夹
# 修改文件A的名字为文件B
  mv 文件A 文件B
# 修改主机名,需要重新远程连接才生效
	[root@localhost ~]# hostname server #临时修改,重启linux系统之后失效
	[root@localhost ~]# hostnamectl set-hostname server #永久生效,修改的是文件内
容。重启linux系统后依旧生效
#查看主机名配置文件
[root@localhost ~]# cat /etc/hostname
server

To be continued, continue to update!!!

Guess you like

Origin blog.csdn.net/Zombie_QP/article/details/127423711