Linux commands commonly used by software testers

At present, many companies' test environments are built on the CentOS system. The
CentOS system (Community Enterprise Operating System, Chinese meaning community enterprise operating system) is one of the Linux distributions.

So what do testers need to do with Linux commands?
1. Deploy and maintain a test environment
2. View service logs to locate problems
3. Other

Next, I will introduce some simple, commonly used Linux commands for software testers
1. cp ab : copy a to form a b file
2. mv ab : rename a to b
3. rm a : delete a rm -fa : Forcibly delete a
4. Filter the condition to view the log, for example, view the record with start in the a.log file: tail -f a.log | grep "start"
5. View the historical log and filter, the number of entries is customized: tail -5000f a .log | grep "start"
6. Go to the specified directory, the path is according to your own, you can check from the root directory wherever you are currently: cd /… /…
7. View the current path: pwd
8. Go to some files editing, for example: vi a.config if vim can also be equipped with the vim a.config
9. use vi a.config into the file you want to edit, the keyboard, insert the key, after editing finished press ESC, enter :! wq be Save, enter : q! If you do n’t save
10. Use vi a.config to find b after entering the file, then enter / b contains the scalar of b
11. Replace a in the file with b and type :% s # a # b # g
12. Create a new .sh file, touch a.sh
13. Display the file containing a in the current directory, ls -da *
14. The file is compressed into a.tar.gz format, tar.gz a
15. Unzip the a.tar.gz format file, tar -zxvf a.tar.gz
16. Shortcut key to paste shift + insert
17. Delete the first section of tead.txt One line sed '1d' tead.txt

More commonly used commands will be used later, and will be added later in the text.

Published 22 original articles · praised 5 · visits 4315

Guess you like

Origin blog.csdn.net/weixin_42231208/article/details/97611111