rqdmap
博文
/
Posts
算法
/
ACM
漫评
/
Anime
黑洞
/
Archive
关于
/
About
日志
/
Changelog
统计
/
Statistics
订阅
/
RSS
开往
/
Travelling
博文
/
Posts
算法
/
ACM
漫评
/
Anime
黑洞
/
Archive
关于
/
About
日志
/
Changelog
统计
/
Statistics
订阅
/
RSS
开往
/
Travelling
Shell
SUID与程序执行
2023.07.14 15:08
2023.07.24 21:44
Linux
Shell
文件系统
程序执行
1418字
在之前的博客ArchLinux调优: 显卡、声卡与电源 - rqdmap | blog中说明了如何使用开源的nvidia驱动并且关闭nvidia的供电来使得笔记本续航能力的提升. 通常来说我们不希望每次开机后都要手动向bbswitch写off字符串, 因而一般委以重任给dm; 不过像ly这样的纯终端dm貌 ...
duu: 按照大小排序的du指令
2023.03.13 12:12
2023.05.29 23:05
Linux
shell
du
276字
正确的办法! du -d 1 -h | sort -hr duu du 指令无法以可读的形式按照大小排序, du -d 1 -h | sort -nr并不正确, 因而写一个简单的脚本进行实现. 1use std::env; 2 3fn main() { 4 let args: Vec<String> = env::args().collect(); 5 assert!(args.len() >= 2); 6 7 if args[1].len() > 18 { 8 println!("Number too large"); 9 return; 10 } 11 12 for c in args[1].chars() { 13 if !c.is_digit(10) { 14 println!("Invalid number"); 15 return; 16 } 17 } 18 19 let nr_bytes = args[1].parse::<u64>().unwrap(); 20 /* KB -> MB -> GB */ 21 22 let mut level: usize = 0; 23 let mut tmp = nr_bytes; ...
LFS包管理与Shell脚本
2023.02.19 14:27
2023.09.01 18:14
Linux
Shell
包管理
LFS
7264字
参考文档 More Control and Package Management using Package Users (v1.4) 工具包: more_control_helpers Shell 编程 特殊变量 $开头的一些特殊变量: 1Special Parameters 2 The shell treats several parameters specially. These parameters may only 3 be referenced; assignment to them is not allowed. 4 * Expands to the positional parameters, starting from one. When the 5 expansion is not within double quotes, each positional parameter expands to 6 a separate word. In contexts where it is performed, those words are 7 subject to further word splitting and pathname expansion. When the 8 expansion occurs within double quotes, it expands to a single word with the 9 value of each parameter separated by the first character of the IFS 10 special variable. That is, "$*" is ...
trash:取代危险的rm
2023.01.01 13:23
2023.05.29 23:05
Linux
rm
shell
594字
rm 指令十分的危险… 为此希望实现一个回收站. archwiki给出了一些可用的建议Trash management, 用下来体验不好, 打算自己搞一个. 第一版的trash自己解析了输入的参数.. 然后加上unix时间戳后mv到一个指定的公共磁盘分区上(因而其实性能也不太好, 尤其是大文件的删除时), ...
创建时间
修改时间
字数