Skip to content

Repository files navigation

mac-utils

This is a toolbox on Mac OSX or Linux.

Table of Contents

macOS Tips

  • 把Finder中的文件直接拖拽到terminal可以立即显示文件的路径

  • 在终端下通过 open $dirpath 可以打开某个文件夹,或者在Finder中使用 shift+command+g 快捷键前往某个路径

  • say Mac OS X,通过 say 命令进行语音阅读

  • Mac上的 otool -L 等同于Linux上的 ldd 命令

  • Mac上的 otool 等同于Linux上的 objdump,也可以通过brew search/install binutils,然后使用 gobjdump

    • otool -tV <executable> to disassemble
    • gobjdump -a libcrypto.a to see mach-o-i386 or something
  • Mac上使用 dtruss 命令跟踪某个进程,对应Linux上的strace命令

  • Mac上使用 sysctl -a 查看系统的相关信息

    • 在Linux上查看cpu的信息,可以cat /proc/cpuinfo
    • 在Mac上,则可以sysctl -a machdep.cpu
  • Mac上的 top 命令用法和Linux上有些不同

  • Mac上使用 lsof 查看监听端口信息

    • 查看所有监听的端口:lsof -i -P | grep LISTEN
    • 查看特定端口的监听情况:lsof -i :8080
  • 使用nslookup domain [dns-server]查询DNS的记录,查看域名解析是否正常


END

About

This is a toolbox on Mac OSX or Linux.

Topics

Resources

Code of conduct

Contributing

Stars

45 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages