linux常用命令

一丶硬件型

  1. 查看操作系统版本
1
2
3
4
lsb_release -a

uname -a

  1. 查看磁盘使用情况
1
2
3
df
//单位G
df -TH
  1. “任务管理器”
1
top

一丶

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@hecs-409746 /]# cd home/
[root@hecs-409746 home]# mkdir test
[root@hecs-409746 home]# cd test/
[root@hecs-409746 test]# ls
[root@hecs-409746 test]# touch test.txt
[root@hecs-409746 test]# ls
test.txt
[root@hecs-409746 test]# vi test.txt
[root@hecs-409746 test]# cat test.txt
hello world linux
[root@hecs-409746 test]# echo 'hello' > test.txt
[root@hecs-409746 test]# cat test.txt
hello
[root@hecs-409746 test]# rm test.txt
rm: remove regular file 'test.txt'? y
[root@hecs-409746 test]# ls
[root@hecs-409746 test]# mkdir testdir
[root@hecs-409746 test]# ls
testdir
[root@hecs-409746 test]# rm -r testdir/
rm: remove directory 'testdir/'? y
[root@hecs-409746 test]# rm -rf

下载

wget 链接

tar zxvf 文件

tar zcvf 文件压缩名 文件

//查看进程
ps -ef | grep 正则
kill -9 PID

//查看服务
service sshd status

systemctl status firewalld.service