First knowledge Linux-2

Source: Internet
Author: User

1. rm leo/a * can delete all files with a in the leo folder, while rm-r leo/a * can delete all files and folders with a in the folder.

2. ls-l-d dc/* 2 indicates that if a directory containing 2 is encountered, you can check the information of the directory if you do not enter the directory, while ls-l dc/* 2 only checks the information of all the files in the dc that contain 2 and the files in the folder that contain 2, but the files in the folder do not necessarily contain 2, but you cannot view the information of the directory containing 2. To view the information, you can only use-d );

3. rm a * B indicates that all objects ending with a and ending with B can be deleted. rm a * B * c indicates that a is hitting a, and there is a B in the middle. All objects ending with c can be deleted;

4, "?" Represents any character;

5, f [] indicates matching a character such as: f [B-j], rm f [B-j], that is, deleting fb to fj, f [1-9] indicates that f1 is deleted to f9, but f [1011] does not indicate that f10 and f11 are deleted, because such a delete operation contains only a few characters, f [4-12] indicates an f1 to f4 match or a single character must be matched)

6. You can also view the content of a file or directory. more can display the screen, while cat adds a line of Space key to show all content, and enter creates a screen, the role of less is to show the advantages of less than more in the split screen. You can view the content of the file at will, just want to see the first few lines of the file with the head usually the first 10 lines) head-10, you only want to check the last few rows and use tail to check the last 10 rows.

7. wcword count is used to calculate the number of rows. The number of words is accurate. If there is no space, it is regarded as a word, so it is inaccurate ), number of characters, wc-l, only count the number of lines, wc-w only count the number of words, wc-c only count the number of characters,

8. grep soft1/etc/passwd indicates to search for rows containing the "soft1" string in a file.

9, grep-I Soft1/etc/passwd, "-" I indicates case-insensitive

10. If you want to find a row without something, use grep-v 01/etc/passwd to search for rows without 01 characters in that file.

11, grep 01/etc/passwd | more indicates that the previous command is output to the next command.

12. vi contains two working states: 1. Command status initialization status), 2. Insert status. Enter I, a, o from command status to insert status, enter ESC from the insert status to the command status. The command status contains the baseline mode. In the command status, the command status is used as a command, and the command status is used as a text. to exit from the command status, Run ": q!" Force exit,

13. PID: process ID, PPID: parent process ID, S indicates sleep), R indicates running, and T indicates suspension.

14. ps-e displays the processes of all terminals.

15. Zombie process: the process has ended but still occupies resources. The process in Z state is a zombie process.

16. Who created a process, who is the parent process, and the parent process of bash is gnome-terminal

17, zzyleoo @ ubuntu :~ $ Ps-f-p 1

UID PID PPID C STIME TTY TIME CMD

Root 1 0 0 :16? 00:00:00/sbin/init

The initialization process is init: The process ID is always 1, and the process whose process is 0 does not exist in linux.

18. The command used to view background tasks is jobs. The command used to switch background tasks to the foreground is fg, And the paused background tasks are executed in the background using bg.

19. kill and add the process number to kill the process, and use kill and add % to kill the process.


This article is from the "zzyleoo" blog, please be sure to keep this source http://zzyleoo.blog.51cto.com/6648011/1300970

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.