30天程序语言研究

今天是30天程序语言研究的第三十天,由於最近写unix语言的东西用到很多,所以做了很多笔记,就想说也分享给大家。

笔记:
mv:
mv file 路径/ 把file搬到路径位置
mv a b 把a搬到b并删除a
pwd:
pwd 显示当前所在位置
pwd -P 建立目录的软连结进入软连结後输入以显示实际路径
ex. cd dir2 进入软连结dir2
pwd =>/home/user/dir2
pwd -P =>/home/user/dir1/dir2
ps:
ps 显示PID/ TTY/ TIME/ CMD
-l 查自己bash程序的
aux查所有系统运作的程序
ex. ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem
-e 输出所有行程资讯
-o 栏name 指定输出栏位
pid:行程 ID(process ID)。
ppid:父行程 ID(parent process ID)。
cmd:程序名称。
%mem:记忆体使用量(百分比)。
%cpu:CPU 使用量(百分比)。
rm:
rm file 删除档案file
rm –r dir 删除整个目录dir
rm -f file/dir 不会有询问动作
ex. rm dir/* 删除dir内所有档案但不删dir
rmdir dir 删除空的dir'
rmdir -p dir1/dir2/dir3 删除多层空目录(若不为空则删到那层为止)
ex. dir1/dri2/dir3.aa
rmdir -p dir1/dir2/dr3 删掉dir3而已
ex.
https://ithelp.ithome.com.tw/upload/images/20220109/20142566l9wfO5rXUn.png
rm -rf ls |grep -v ^t$ 除了t以外的档案/目录都删除
rm -rf ls |grep -v ^t t开头的保留其他都删(^?t,^*t会直接清空全部)
w:
w 看现在有多少使用者
write:
丢讯息给其他"在线"使用者
write username (tty) => 讯息(英数) =>ctrl c (tty可不打)
ex.
w => USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
user1 pts/0 172.16.xx.2xx 08:56 4:44 0.30s 0.30s -bash
user2 pts/1 172.16.xx.3xx 09:52 2.00s0.02s 0.00s w
write user2 (pts/0)
hihihihihi
ctrl c =>对方收到


<<:  30天程序语言研究

>>:  有关文组转工程师 聊聊

Day 08:八爪章鱼之 tmux 快捷键

今天的 Home 目录没有修改,https://github.com/simba-fs/2021-...

[Day 11] 第一主餐 pt.4-Djgnao,进化

在上一篇我们成功运行了django专案 今天我们要来加点东西,让我们的django成为一个web框架...

Day7: 今天来聊一下Azure AD Identity Protection

今天来聊一下Azure AD Identity Protection Azure Active Di...

Day16-"与字串相关的函式-2"

复制字串 i.strcpy() 宣告时宣告另一空字元字串,当strcpy()执行完毕时,就会将此字...

Day26,Kubecost 体验,算钱好难......

正文 kubectl create ns kubecost wget https://raw.git...