mac os useful things: scripts shells doc

前端之家收集整理的这篇文章主要介绍了mac os useful things: scripts shells doc前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

下面是编程之家 jb51.cc 通过网络收集整理的代码片段。

编程之家小编现在分享给大家,也给大家做个参考。

# 查看某个工具编译出来的时间
$(which appname)  

# 常用for循环
for i in 1 2 3 4 5; do echo "$i"; done;  

for((i=140;i<200;i++)); do git tag -d v1.3.$i;done; 

# 常用读取文件
cat filename | while read line  
do  
    echo $line  
done 

# "[email protected]"的神奇之处 "[email protected]" 的 参数如果是 “test test” 会直接输出。不会分开
for i in "[email protected]"; do  

# mail和mutt的使用
echo hello| mail -s "test" "[email protected]" -f "[email protected]"  
echo | mutt -a syslogs.tar.gz [email protected]  

# 删除当前目录下面所有 .DS_Store
find $PWD -name ".DS_Store" -exec rm -f {} \;

#查看当前文件夹的总大小
du -sh dirname

# 使用caffeinate阻止Mac运行屏幕保护和睡眠
caffeinate -t 3600

# 使用pkgutil解压PKG文件
pkgutil --expand macx.pkg ~/Desktop/

# 使用purge命令释放内存
purge

# 使用open命令开启多个相同应用
open -n /Applications/Safari.app/

# 不通过App Store更新OS X
sudo softwareupdate -i -a

# 将所有下载过的文件列出来
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' |more

# 使用chflags命令隐藏文件文件夹,如果你想再次看到文件夹,只需将hidden改为nohidden即可。
chflags hidden ~/Desktop/macx

# 创建有密码保护的压缩文件
zip -e protected.zip ~/Desktop/macx.txt

以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

猜你在找的Shell相关文章