Here are some of the commands commonly used in testing. Not specifically labeled, for Linux and Mac systems.

View the process that occupies the port

Linux

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

Windows

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

Kill the process

Linux

aaron@ubuntu:~$ kill -9 69080

Windows

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

If you do not have enough permissions under Windows, you can right-click the Start button to start PowerShell in administrator mode.

View the process by name

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

Use grep-v grep to filter out the viewing process itself.

Command line pipeline

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

Use a pipe here to kill the process named nginx.

Using | pipe, transfer the standard output of the command for the next command's standard input; Use awk to print the second column of the captured row, separated by Spaces or Tab symbols; Using xargs, the standard output of the previous command is converted to the parameters of the next command.

Background running service

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

Runs the AppIum service in the background for the phone with the specified serial number SN.

Modify the file

Find the line in the zd.conf file that starts with “Version” and replace it with “Version = 2.0”.

Linux

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

Mac

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

Copy the directory to the remote

SCP -r bin/utl - server / 0.8 / Linux/utl - server 139.224.8.129: ~

View file contents in real time

Aaron @ ubuntu: ~ $tail -f jmeter. Log the 15:11:51 2021-04-25, 723 INFO O.A.J.P.H.S.H TTPSamplerBase: Parser for text/XML is org, apache jmeter. Protocol. HTTP. Parser. LagartoBasedHtmlParser 15:11:51 2021-04-25, 723 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/VND. Wap. WML is org.. Apache jmeter. Protocol. HTTP. Parser. RegexpHTMLParser 15:11:51 2021-04-25, 723 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/CSS is org, apache jmeter. Protocol. HTTP. Parser. CssParser 15:11:51 2021-04-25, 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.S ampleResult: sampleresult.useNanoTime=true

View running services

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

View service status

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)

Restart the service

aaron@ubuntu:~$ sudo service apparmor restart

Check memory status

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

Check disk health

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

Monitoring system status

aaron@ubuntu:~$top top-09:29:37 up 378 days, 16:35, 1 user, load average: 0.00, 0.00, 0.00 Tasks: ~$top top-09:29:37 up 378 days, 16:35, 1 user, load average: 0.00, 0.00, 0.00 146 total, 1 running, 145 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.2us, 0.1sy, 0.0ni, 99.8id, 0.0wa, 0.0hi, 0.0si, 0.0st KiB Mem: 0.2us, 0.1sy, 0.0ni, 99.8id, 0.0wa, 0.0hi, 0.0si, 0.0st 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 3296S 0.3 0.1 308:04.26 redis server

On Windows, right-click the taskbar and select Task Manager.