命令行杂记

将所有mp3都复制到一个目录
find ~/Music/iTunes/ -name *.mp3 -exec cp {} ~/Desktop/Music/  \; 

新建文件: touch index.html 

查看IP:ifconfig
 
查看文件的全路径:pwd
 
新建文件夹:mkdir filename 
 

移动文件: mv /System/Library/Extensions/AppleHDA.kext /System/Library/Extensions/backup

 
MySql目录 :/usr/local/mysql-5.6.11-osx10.7-x86_64/bin 
 
MySql命令:./mysql -h localhost -u root -p 
 
更改权限:sudo chmod 777 profile 
 
删除svn信息: sudo find /Users/issuser/Desktop/src -name ".svn" -exec rm -r {} \; 
 
显示.a文件的属性:find . -name *.a -exec lipo -info "{}" \;
 
显示.framework文件的属性:find . -name *.framework|awk -F "/" '{print $0"/"$NF}'|sed 's/.framework$//g'|xargs lipo -info;
 
显示隐藏文件:defaults write com.apple.finder AppleShowAllFiles -bool true 
 

如果要统计ios开发代码,包括头文件的,命令如下:

find . -name "*.m" -or -name "*.h" |xargs grep -v "^$"|wc -l

 
Xcode iPhoneSimulator 所在位置:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ 
 
 
搜索文件:
sudo find / -name "652b7aa5-0bff-4634-a65a-64c1583562de.mobileprovision"
 
xcode mobileprovision 文件所在目录
/Users/username/Library/MobileDevice/Provisioning Profiles/
 
 
修改文件夹权限:

例:把驱动目录下所有文件设定到root读写,其他用户只读(755)777全部 root

chmod -R 777 /System/Library/Extensions
 
Xcode 项目残余: /Users/issuser/Library/Developer/Xcode 
 
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l
 
posted @ 2015-03-12 10:45  CodingTom  阅读(148)  评论(0编辑  收藏  举报