`
isiqi
  • 浏览: 16702428 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

在命令行检查mac os的系统状态

阅读更多
So I'm logging into a Mac OS X machine (Server or not) remotely by ssh to do some maintenance and check on the health of the system. What I might be interested in is how CPU, memory and disk usage is coping with the jobs the server has to do. If I was sitting in front of the machine I could open "Activity Monitor" and click my way through the GUI. Not an option for this machine, since there is no GUI level remote access. So what do I do? There are some command line tools to give me the information I need, let me show you top, vm_stat and iostat... On my OpenBSD box "systat vmstat" is what I use for a full overview. That is not available for OS X, but some other tools are there. Most often used is "top", followed by "vm_stat" and "iostat". top "top" is well known and you likely have heard about it and probably used it before. The version on OS X is quite useable. After switching to "compatibility mode" (with 'x'), one can see only the processes of a single user (with 'U' and entering the user id or name). Top is good for checking what eats all the CPU time. vm_stat If it comes to memory usage, especially for the question "how much swap space am I using", then vm_stat can help. On Mac OS X that's vm_stat with an underscore, not vmstat. You just give vm_stat a delay in seconds (by calling it like "vm_stat 10" on the command line) and it updates the display repeatedly. Go on, try that out and then open a bunch of applications to see if pageouts are going up (which would mean that your machine has to page memory out on disk to make room for the new ones). $ vm_stat 5 Mach Virtual Memory Statistics: (page size of 4096 bytes, cache hits 58%) free active inac wire faults copy zerofill reactive pageins pageout 49314 97619 154001 26746 42361341 320895 24148787 145786 50308 3459 49341 97814 153974 26551 2902 21 1429 0 0 0 45297 98409 157246 26728 12056 805 5639 0 272 0 40400 101288 158727 27265 14663 841 6746 0 1261 0 36365 103524 160004 27787 8302 712 3519 0 1630 0 ...looks like my workstation is OK, even with starting up Acrobat Reader and a bunch of smaller programs at once. iostat It took me longer to discover iostat. The man page says that "Iostat displays kernel I/O statistics on terminal, device and cpu operations." Which is quite a lot and probably more than I usually want. I just use it with a line like: iostat -d -K -w 5 to show me only devices (-d), kilobytes instead of blocks (-K), and have a wait interval of 5 seconds (-w 5). Go ahead, try it and watch it while doing a find for "foobar" on your disks. As usual with all command line tools, read the fine man pages. $ iostat -d -K -w 5 disk0 KB/t tps MB/s 16.90 1 0.01 31.79 131 4.07 32.00 752 23.51 32.00 35 1.10 4.00 1 0.00 0.00 0 0.00 ^C Finding all files that start with "pimp" on my single disk got the activity up a bit, then I stopped it with control-C. The display shows me Kilobytes per transfer, transfers per second, and Megabytes per second. Interpretation is of course up to you not to the tool :-). Playing with the -I switch might be interesting.
分享到:
评论

相关推荐

    在Mac OS中为命令行界面和VIM添加状态提示栏的教程.docx

    在Mac OS中,为了提升命令行界面和VIM编辑器的用户体验,可以通过添加状态提示栏来显示当前工作状态和各种信息。本教程将详细介绍如何在命令行和VIM中实现这一功能,主要涉及Powerline的安装和配置。 Powerline是一...

    systeminfo for mac os

    在Mac OS操作系统中,了解和检查系统的硬件信息是日常维护和故障排查的重要步骤。`systeminfo`命令在Windows系统中广泛用于获取系统详细信息,而在Mac OS中,虽然没有直接对应的`systeminfo`命令,但我们可以使用...

    apache-tomcat-7.0.52.zip for mac os

    这个版本是专门为Mac OS操作系统设计的,允许开发者和系统管理员在苹果计算机上部署和运行Java Web应用。下面将详细介绍关于Apache Tomcat 7.0.52及其在Mac OS上的安装和使用的一些关键知识点。 1. **Apache Tomcat...

    Mac OS 上部署Tensorflow

    1. 在Mac OS上安装Tensorflow之前,需要先安装Python包管理工具pip。如果系统中已经安装有Python,可以通过命令行安装pip。如果系统中没有安装Python,可以选择安装Python3,并安装pip3。此外,Tensorflow安装过程中...

    玩转Mac OS X

    在这个阶段,系统还会选择一个操作系统版本来启动,例如Mac OS 9或Mac OS X。如果选择了Mac OS X,则会加载BootX程序。 **1.3 BootX与内核加载** BootX程序位于/System/Library/CoreServices目录下。它的主要任务...

    Mac+OSX的文件系统

    在Mac OS X中,用户可以通过Finder、Terminal或者第三方工具来管理文件系统,例如创建、删除文件和目录,修改权限,检查磁盘状态等。定期进行磁盘检查和修复(如使用`diskutil`命令)是保持文件系统健康的重要步骤。...

    Mac OS X 应该如何维护和保养.docx

    这些脚本会在特定时间执行,例如清理临时文件、更新数据库、检查系统状态等。为了确保这些脚本能正常运行,你需要确保系统在设定的时间段内不关机或休眠。 2. **清除缓存 (Caches)**: 缓存文件会占用磁盘空间,随着...

    Mac OS 终端利器 iTerm2

    在Mac OS系统中,内置的Terminal应用尽管能满足基本的命令行操作需求,但其功能相对较为有限,界面也不够个性化。对于那些频繁在命令行环境下工作的开发者或者系统管理员,一款强大的终端工具就显得尤为重要。这时,...

    ROUTEROS密码清除工具

    根据不同的操作系统,可能是双击运行Windows版本的.exe文件,或者在终端中运行Linux或Mac OS版本的脚本。 4. **设备识别**:工具会自动扫描网络中运行RouterOS的设备。如果无法自动识别,你可能需要手动输入设备的...

    is-camera-on-cli检查内置的Mac相机是否打开

    在Mac OS中,摄像头的使用情况可以通过系统偏好设置或者隐私权限管理进行查看,但`is-camera-on-cli`提供了一种快速、命令行级别的解决方案。只需在终端中运行一个简单的命令,就能得到摄像头当前是否开启的答案。 ...

    精通windows server 2008 命令行与powershell电子书PDF版(第一卷)

    Windows Server 2008系统内置功能强大的命令,可在命令行模式下完成所有可在Windows界面下执行的操作,尤其在执行脚本、批处理等操作时,更加方便快捷. 以实践为主,突出实用性、针对性和技术性.. 列举大量实例,...

    Mac OS启动服务优化高级篇.docx

    3. **延迟启动**:对于某些不急需在系统启动时立即运行的服务,可以设置延迟启动,减少系统启动时的资源占用。 4. **调整服务优先级**:通过设置`RunAtLoad`或`KeepAlive`等键值,控制服务的启动顺序和保持运行状态...

    CMD资料(包括windows,linux,MAC)

    这个压缩包包含了关于CMD以及在不同操作系统环境(Windows、Linux和Mac)下使用命令行工具的相关资料。 首先,我们来看CMD教程.chm和CMD命令全集.chm这两个文件。CHM是Microsoft的 Compiled HTML Help 文件格式,...

    精通windows server 2008 命令行与powershell电子书PDF版(第三卷)

    Windows Server 2008系统内置功能强大的命令,可在命令行模式下完成所有可在Windows界面下执行的操作,尤其在执行脚本、批处理等操作时,更加方便快捷. 以实践为主,突出实用性、针对性和技术性.. 列举大量实例,...

    精通windows server 2008 命令行与powershell 电子书PDF单文件完整版

    7.5.29 show os——显示操作系统信息 339 7.5.30 show test——显示对象的连接 339 7.5.31 show version——显示操作系统版本 340 7.5.32 show wins——查看WINS服务器 340 7.6 eventvwr——Windows 事件查看器 341 ...

    MAC kext安装工具

    标题中的“MAC kext安装工具”指的是用于在Mac OS操作系统中安装Kernel Extension(简称kext)的专用软件。Kernel Extensions是Apple macOS系统中用于扩展内核功能的动态库,允许开发者为系统添加新硬件支持、驱动...

    ALU OS6900 配置手册.pdf

    可以通过命令行或其他工具来检查端口的状态和设置。 ### 3. 管理源学习 #### 3.1 MAC地址表项配置例子 MAC地址表是交换机用来决定如何转发数据帧的关键数据结构。通过配置MAC地址表项,可以实现更精细的流量控制。...

    检查文件是否存在

    在Windows、Linux或Mac OS等操作系统中,用户可以通过命令行工具(如cmd、bash或Terminal)执行文件存在性检查,但更常见的是在编写程序时进行这种检查。下面我们将深入探讨几种常用编程语言中检查文件存在的方法。 ...

    mysql5.7.23 for mac os x10.13+ & navicat.zi及密码修改、设置、启动及常见问题整理

    MySQL 5.7.23 是 MySQL 数据库管理系统的一个稳定版本,特别针对 Mac OS X 10.13 及以上版本进行了优化。这个压缩包包含了一系列与在苹果...通过这些资源,用户可以有效地在 Mac OS X 系统上搭建和管理 MySQL 数据库。

Global site tag (gtag.js) - Google Analytics