大话2免费版一级星盘炼化表

    1. <form id=zhudObCNh><nobr id=zhudObCNh></nobr></form>
      <address id=zhudObCNh><nobr id=zhudObCNh><nobr id=zhudObCNh></nobr></nobr></address>

      測試開發之系統篇-常用系統命令

      原創

      以下介紹測試工作中常用的一些命令。未專門標注的,爲Linux和Mac系統下的。

      查看占用端口的進程

      Linux

      aaron@ubuntu:~$ lsof -i :8085 | grep LISTEN
      ___server 69080 aaron   11u  IPv6 0x5624b7cdebdb6b7b      0t0  TCP *:8085 (LISTEN)

      Windows

      C:>netstat -aon | findstr :80 | findstr LISTENING
        TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       2588
        TCP    [::]:80                [::]:0                 LISTENING       2588

      殺死進程

      Linux

      aaron@ubuntu:~$ kill -9 69080

      Windows

      PS C:\WINDOWS\system32> taskkill /F /PID 8152
      SUCCESS: The process with PID 8152 has been terminated.

      Windows下權限不足的,可右擊 開始按鈕,用管理員模式啓動PowerShell。

      按名稱查看進程

      aaron@ubuntu:~$ ps -ef | grep nginx | grep -v grep
      root     21471     1  0  2020 ?        00:00:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
      www-data 21472 21471  0  2020 ?        00:07:55 nginx: worker process

      使用grep -v grep过滤掉该查看进程本身。


      命令行管道

      aaron@ubuntu:~$ ps -ef | grep nginx | grep -v grep | awk '{print $2}' | xargs kill -9

      此處使用管道,殺掉名爲nginx的進程。

      • 使用|管道符,將命令的標准輸出傳遞爲下一個命令的標准輸入;
      • 使用awk打印所捕獲行的第2列,列按空格或Tab符號進行分割;
      • 使用xargs,將上個命令的標准輸出轉換成下一個命令的參數。

      後台運行服務

      aaron@ubuntu:~$ nohup appium -p %d --default-capabilities '{"udid":"sn"}' > appium.log 2>&1 &

      後台爲指定串號sn的手機運行appium服務。

      修改文件

      查找zd.conf文件中,以“Version”开头的行,替换为“Version = 2.0”。
      Linux

      sed -i "s/Version.*/Version = 2.0/" zd.conf

      Mac

      gsed -i "s/Version.*/Version = 2.0/" zd.conf

      複制目錄到遠程

      scp -r bin/utl-server/0.8/linux/utl-server 139.224.8.129:~

      實時查看文件內容

      aaron@ubuntu:~$ tail -f jmeter.log
      2021-04-25 15:11:51,723 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
      2021-04-25 15:11:51,723 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
      2021-04-25 15:11:51,723 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser
      2021-04-25 15:11:51,789 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
      2021-04-25 15:11:51,789 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
      2021-04-25 15:11:51,789 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true

      查看正在運行的服務

      aaron@ngtesting-lab:~$ systemctl | grep apparmor
        apparmor.service.     loaded active exited    LSB: AppArmor initialization

      查看服務狀態

      aaron@ubuntu:~$ service apparmor status
      ● apparmor.service - LSB: AppArmor initialization
         Loaded: loaded (/etc/init.d/apparmor; bad; vendor preset: enabled)
         Active: active (exited) since Fri 2021-05-28 09:42:26 CST; 18s ago
           Docs: man:systemd-sysv-generator(8)
        Process: 19969 ExecStop=/etc/init.d/apparmor stop (code=exited, status=0/SUCCESS)
        Process: 20185 ExecStart=/etc/init.d/apparmor start (code=exited, status=0/SUCCESS)

      重啓服務

      aaron@ubuntu:~$ sudo service apparmor restart

      查看內存狀況

      aaron@ubuntu:~$ free -h
                    total        used        free      shared  buff/cache   available
      Mem:           7.8G        2.3G        931M         40M        4.6G        5.2G
      Swap:            0B          0B          0B

      查看磁盤狀況

      aaron@ubuntu:~/ df -h
      Filesystem      Size  Used Avail Use% Mounted on
      udev            3.9G     0  3.9G   0% /dev
      tmpfs           799M  3.4M  795M   1% /run
      /dev/vda1        40G   33G  4.8G  88% /
      tmpfs           3.9G  8.0K  3.9G   1% /dev/shm
      tmpfs           5.0M  4.0K  5.0M   1% /run/lock
      tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
      tmpfs           799M     0  799M   0% /run/user/1000

      監控系統狀況

      aaron@ubuntu:~$ top
      top - 09:29:37 up 378 days, 16:35,  1 user,  load average: 0.00, 0.00, 0.00
      Tasks: 146 total,   1 running, 145 sleeping,   0 stopped,   0 zombie
      %Cpu(s):  0.2 us,  0.1 sy,  0.0 ni, 99.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
      KiB Mem :  8174708 total,   953320 free,  2365784 used,  4855604 buff/cache
      KiB Swap:        0 total,        0 free,        0 used.  5426472 avail Mem
        PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
      14459 root      10 -10  135204  17124  14024 S   0.7  0.2   2:52.83 AliYunDun
        956 root      20   0 2428132  92556  16208 S   0.3  1.1   2690:07 java
       3217 999       20   0   90232   7264   3296 S   0.3  0.1 308:04.26 redis-server

      Windows系統下,右擊任務欄選擇 任務管理器

      禅道項目
      HoME大话2免费版一级星盘炼化表