栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Linux学习笔记—常用系统命令

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Linux学习笔记—常用系统命令

1.时间日期:

date    显示时间
cal       当月日历(calendar)

[root@localhost ~]# cal
      四月 2022     
日 一 二 三 四 五 六
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30


cal -y     当年日历

2.存储空间:
df-h  磁盘剩余空间(dist'free)
du -h 显示当前目录下所有子目录的文件大小 (-h :人性化显示信息)

[root@localhost ~]# du -h
4.0K    ./.cache/dconf
8.0K    ./.cache/abrt
8.0K    ./.cache/imsettings
0    ./.cache/libgweather
0    ./.cache/evolution/addressbook/trash
0    ./.cache/evolution/addressbook
0    ./.cache/evolution/calendar/trash
0    ./.cache/evolution/calendar
0    ./.cache/evolution/mail/trash
0    ./.cache/evolution/mail
0    ./.cache/evolution/memos/trash
0    ./.cache/evolution/memos
.................

3.查看进程信息:
ps aux  (不需要-号)

//选项:“aux”  一般一起使用,x:所有进程 ‘详细信息’

[root@localhost ~]# ps aux
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root          1  0.0  0.3 193792  6972 ?        Ss   16:15   0:02 /usr/lib/systemd/syst
root          2  0.0  0.0      0     0 ?        S    16:15   0:00 [kthreadd]
root          3  0.0  0.0      0     0 ?        S    16:15   0:00 [ksoftirqd/0]
root          5  0.0  0.0      0     0 ?        S<   16:15   0:00 [kworker/0:0H]
root          7  0.0  0.0      0     0 ?        S    16:15   0:00 [migration/0]
root          8  0.0  0.0      0     0 ?        S    16:15   0:00 [rcu_bh]
............

top 显示排序后的ps信息
(时时监视,动态变化)

输入"top"命令弹出以下窗口

结束进程:
kill  PID  
(先通过使用ps au找出CPU占用率高的PID号)

PID:Process Identification 进程识别号

文件操作:
find  查找文件
grep 查找文件中的内容
mv   移动文件

软连接/硬链接:
ln-s   软连接创建
ln -s  软连接路径 快捷方式名称
ln 没-s  就是硬链接的创建

linux中 文件名和文件数据是分开储存的
(软连接指向文件名,在指向文件数据,硬链接直接指向文件数据)

打包/解包
tar -cvf 打包 打包文件  目录
tar -xvf 解包

压缩/解压(gzip)
tar -zcvf  打包文件.tar.gz   路径
tar -xcvf  解包文件.tar.gz   路径

压缩/解压(bzip2)
tar -jcvf    文件.tar.bz2 路径
tar - jxvf   文件.tar.bz2 路径
-C 解压到指定文件

apt(advanced packging tool)
安装包管理工具
(一般使用sudo命令提高权限)
apt install 安装
apt remove 卸载
apt upgrade 更新
 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/838777.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号