美文网首页
实用的Shell(一)

实用的Shell(一)

作者: 诺之林 | 来源:发表于2020-12-31 15:40 被阅读0次

查看Home下文件夹大小?

man du
du - estimate file space usage

-s, --summarize
       display only a total for each argument
-h, --human-readable
       print sizes in human readable format (e.g., 1K 234M 2G)
man sort
sort - sort lines of text files

-h, --human-numeric-sort
       compare human readable numbers (e.g., 2K 1G)
-r, --reverse
       reverse the result of comparisons
man head
head - output the first part of files

-n, --lines=[-]NUM
       print the first NUM lines instead of the first 10; with the leading '-', print all but the last NUM lines of each file

如何杀死php-fpm进程?

man ps
ps - report a snapshot of the current processes

To see every process on the system using standard syntax
ps -ef
To see every process on the system using BSD syntax
ps ax
SIMPLE PROCESS SELECTION
a      Lift the BSD-style "only yourself" restriction
-e     Select all processes
x      Lift the BSD-style "must have a tty" restriction
OUTPUT FORMAT CONTROL
-f     Do full-format listing
man grep
grep, egrep, fgrep, rgrep - print lines matching a pattern

-v, --invert-match
       Invert the sense of matching, to select non-matching lines
man awk
gawk - pattern scanning and processing language

n = 5
print $n
prints the fifth field in the input record.
man xargs
xargs - build and execute command lines from standard input
echo hello | echo

echo hello | xargs echo
man kill
kill - send a signal to a process

参考

相关文章

  • 实用的Shell(一)

    查看Home下文件夹大小? 正则表达式[https://zh.wikipedia.org/wiki/%E6%AD%...

  • shell编程1.1: 初步认识

    1. 如何执行shell脚本 每个shell脚本第一行一般是#! /bin/bash,代表其实用的shell解释器...

  • 实用shell

    查看文件件大小

  • 日常

    vim SHELL Python Pycharm Pip Virtualenv Github Chrome实用插件...

  • 实用的Shell(二)

    本文的主线 Shell => Profile=> Env 本文环境基于Ubuntu1604[http://git....

  • 实用的shell脚本

    list_sys_status.sh 显示系统使用的以下信息: 主机名、IP地址、子网掩码、网关、DNS服务器IP...

  • 实用Shell命令

    文件压缩并分卷 (转)使用tar和split打包分割文件[http://www.cnblogs.com/xiaou...

  • 实用 shell 命令

    全局变量 当前目录和时间 当前文件dirname和basename 文件操作 判断文件(或者目录)是否存在 文件内...

  • 实用shell语句

    批量创建多个目录

  • Shell 编程入门

    1. 走进 Shell 编程的大门 1.1 为什么要学Shell? 学一个东西,我们大部分情况都是往实用性方向着想...

网友评论

      本文标题:实用的Shell(一)

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