Linux-Shell-根据inode删除文件和目录 列出文件和文件夹的 inode 1ls -i 根据 inode 删除文件或者目录 12345# 1. 用 find 的 -delete 参数删除目录(空目录)find . -inum 123456 -delete# 将 find 结果传递到 rm 命令进行删除find ./* -inum 123456 -exec rm -i {} \; 2019-11-28 #Shell #Linux
Linux-设置时区 设置时区命令 123456789tzselecttimedatectl# 列出所有可用的时区timedatectl list-timezones# 设置时区timedatectl set-timezone Asia/Singapore 2019-11-27 #Linux #时区
Linux-服务管理命令-systemctl 123systemctl stop iptablessystemctl list-unit-files --type=servicesystemctl daemon-reload # 重新载入 参考:linux systemctl命令详解systemd user services and systemctl –user 用户 .service 文件推荐放在 $USER/.config/syst 2019-11-11 #Linux #systemd #树莓派 #systemctl
macOS-查看和开启APFS卷的碎片整理功能 查看和开启APFS卷的碎片整理功能keywords: apfs defragmentation, apfs defrag Usage: diskutil apfs defragment|defrag | status|enable|disable where = APFS Container DiskIdentifier 2019-11-05 #macOS #APFS #diskutil
macOS-磁盘镜像管理程序hdiutil 功能类似的工具hdiutil diskutil hdiutil创建磁盘镜像文件12345678910111213141516171819202122232425262728293031323334353637# sparse-band-size 后面值中的 32 表示 32MiB 如果需要其它大小可直接修改这个值hdiutil create -size 120g\ -type SPARSEBUND 2019-10-28 #macOS #hdiutil
macOS-macOS中的osascript命令 https://www.jianshu.com/p/d42dff738d70 通过命令行发送系统通知 1osascript -e 'display notification "通知内容" with title "标题" subtitle "子标题" sound name "Submarine"' 2019-10-24 #Shell #macOS
Linux-apt包管理工具 updateupdate 是同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,这样才能获取到最新的软件包。 upgradeupgrade 是升级已安装的所有软件包,升级之后的版本就是本地索引里的,因此,在执行 upgrade 之前一定要执行 update, 这样才能是最 2019-10-23 #Linux #apt #apt-get
Linux-计划任务工具crontab与计划任务cronjob 12345crontab -l # 列出任务crontab -l > $HOME/crontab.bak # 备份任务crontab -e # 编辑定时任务crontab $HOME/crontab.bak # 恢复备份/var/spool/cron/<username> < $HOME/crontab.bak # 恢复备份 crontab 任务执行异常会向/var 2019-10-23 #Linux #crontab #cronjob