网上看的一些神级linux命令

Linux 9个月前 管理员
2,610 3 0

1、CPU占用最多的前十个进程

ps auxw|head -1;ps auxw|sort -rn -k3|head -10

2、内存消耗最多的前十个进程

ps auxw|head -1;ps auxw|sort -rn -k4|head -10

3、虚拟内存使用最多的前十个进程

ps auxw|head -1;ps auxw|sort -rn -k5|head -10

4、查询当前目录下的所有文件

### 统计当前目录下文件的个数(不包括目录)
ls -l | grep "^-" | wc -l
### 统计当前目录下文件的个数(包括子目录)
ls -lR| grep "^-" | wc -l
### 查看某目录下文件夹(目录)的个数(包括子目录)
ls -lR | grep "^d" | wc -l

版权声明:管理员 发表于 2024-05-10 23:15。
转载请注明:网上看的一些神级linux命令 | kk编程驿站

相关文章

3 条评论

  • Temp mail
    Temp mail 游客

    Your writing has a way of resonating with me on a deep level. I appreciate the honesty and authenticity you bring to every post. Thank you for sharing your journey with us.

    未知
    回复
  • temp mail
    temp mail 游客

    Your blog is a constant source of inspiration for me. Your passion for your subject matter shines through in every post, and it's clear that you genuinely care about making a positive impact on your readers.

    未知
    回复
  • healxo
    healxo 游客

    Your blog is a breath of fresh air in the often stagnant world of online content. Your thoughtful analysis and insightful commentary never fail to leave a lasting impression. Thank you for sharing your wisdom with us.

    未知
    回复