美文网首页
Mac 使用技巧

Mac 使用技巧

作者: 默默熊 | 来源:发表于2017-05-16 13:58 被阅读35次

Darwin

Darwin 是开源的。但ios 版不是。
uname -a //查看当前的版本
Darwin Yonglins-Mini.lan 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64

Mac系统的环境变量,加载顺序为:
/etc/profile /etc/paths ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc

常用工具安装

Xcode Commandline Tools:

xcode-select —install
installed path: /Library/Developer/CommandLineTools

brew

安装:访问 http://brew.sh
常用命令:
brew list
brew update
brew install gdb/lua
brew install aircrack-ng

Finder:

Cmd+ Shift + U //Open utility directory

Terminal Command

cd - // Back to where you were
tail -f filename //Follow a file
mkdir -p /dir1/dir2/dir3
Cmd+ K //Clear
Cmd+ +/- //Resize
Ctrl+ a/e //move to the beginning or end of the line
echo $SHELL //show default shell
echo $0 //show current shell

wifi

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
airport -I
airport -s
sudo airport sniff channel
aircrack-ng *.cap | grep 1_ handshake
aircrack-ng -w password.txt -e SSID capfilename.cap

unrar

解压文件:
unrar x filename.rar -ppassword //-photnrg -pwww.pt80.com

Filemonitor:

sudo fse

解压文件

tar -xzvf vlc-ios-2.7.8.tar.gz
tar -xzvf *.tgz

gunzip xxx.tar.xz
tar xvd xxx.tar

sudo systemsetup -getremotelogin
sudo systemsetup -setremtelogin on/off

otool nm
dyldinfo

Leopard(10.5) is the first OS X which got UNIX certification

client port error while execute mdfind.

Metadata.framework [Error]: couldn't get the client port

execute
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

to enable Spotlight and sudo mdutil -i off /

to disable indexing.

Find

Find *.c files which contain PANIC

find ./ -name "*.c" | xargs grep PANIC

C++

gcc -framework ApplicationServices -framework SystemConfiguration QueryConf.c -o queryconf

gcc -lstdc++
gcc
gcc -std=c89
gcc -ansi

Chapter 2
The first user mode process is launchd.

Darwin is a UNIX implementation. 10.5 is the first OS X which get certified.

To enable ssh on OS X, open the ssh.plist under /System/Library/LaunchDaemons. Then change the value for disable to false. Or remove the key completely.

应用程序的默认设置保存在属性列表中。 ~/Library/Preferences 或 /Library/Preferences

命令: defaults
LaunchServices 框架负责使用关联的程序打开文件。 和 launchd 无关。LaunchServices 的数据库可以用 lsregister 程序导出。
reset the database. lsregister -kill -r -domain local -domain system -domain user

Framework bundle 内建版本化机制 框架可以包含多个版本的代码

Cocoa 框架包含了其他3个框架:Appkit, CoreData 和 Foundation.
框架是特殊形式的库

otool可以对二进制文件进行反汇编(-tV)
otool -L libSystem.B.dylib // Check the dependency of a library
otool -arch i386 -tV /usr/lib/libSystem.B.dylib | more
otool -arch x86_64 -tV /usr/lib/libSystem.B.dylib | more
dyld // Mach-O 加载器

OS X 的目标文件格式 Mach-O 和 ELF 不兼容。 POSIX兼容性是由XNU中BSD层提供的。32位系统中,Mach系统调用的编号都为负数。POSIX只定义了非负的系统调用

相关文章

  • Mac使用技巧(持续更新……)

    Mac使用技巧 @(帮助文档)[帮助, Mac, 读书笔记, Markdown]本篇旨在收集在mac的使用过程中,...

  • Mac Photoshop CC怎么使用?PS操作指南

    Mac Photoshop CC怎么使用更简单?Ps操作技巧看这里。最近使用Mac Photoshop CC的伙伴...

  • Mac使用技巧,提高你的工作效率(持续更新中)

    该篇文章旨在介绍一些实用的mac使用技巧。对于已经使用mac或者刚刚接触mac的萌新都会有所收获。 快速定位 给我...

  • mac使用技巧

    iterm 安装ohmyzsh 增加自动补全历史命令 然后编辑vim ~/.zshrc文件,找到plugins配置...

  • Mac 使用技巧

    Darwin Darwin 是开源的。但ios 版不是。uname -a //查看当前的版本Darwin...

  • Mac 使用技巧

    收集一些常用的设置 调整launchpad图标排列 调整每一行显示图标数量(#代表你要显示的行数) 重启dock ...

  • mac使用技巧

    1、如何显示隐藏文件:Command+Shift+. 可以显示隐藏文件、文件夹,再按一次,恢复隐藏;finder下...

  • Mac使用技巧

    1.系统级别放大缩小Mac系统 比如使用Xcode展示代码的时候,放映PPT中有图片的时候。 快捷键:option...

  • Mac 使用技巧

    新版 MacPro 入手 3 月多了。 简单说说使用的心得,好用的软件和一些小技巧吧。 外观 Dock 在没用 M...

  • MAC使用技巧

    1. ctrl+space 查找程序功能 command+i 各软件下作用不同 command+delete删除文...

网友评论

      本文标题:Mac 使用技巧

      本文链接:https://www.haomeiwen.com/subject/tudlxxtx.html