Take stock of some practical Linux tips
Linux is a powerful operating system with many useful commands and tips to help you use it more efficiently.
1. Check the file check value
During the file copying or transmission process, the file may be damaged or modified. In this case, the check value can be used for verification.
Usually, we need to use some interface programs provided by other teams in our work. Whenever the running results of these programs are not as expected, we will compare the md5 check values of both parties to confirm the consistency of the data.
There are many ways to generate the check value of a file. Commonly used ones include md5sum check, crc check, sum check, etc.
Thecommands are:
md5sum file_name cksum file_name sum 算法参数 file_name
For example:
Let’s take a test.txt file as an example:
- md5sum verification
md5sum test.txt
- crccheck
cksum test.txt
- sum verification
There are two algorithms for sum verification, which we can configure through parameters:
-r: Indicates using the system v algorithm. -s: Indicates using the BSD algorithm.
When we do not configure it, the system v algorithm is used by default.
sum -r test.txt sum -s test.txt
2. Find the file location
(1)locate
Everyone is usually accustomed to using find to find files, but I think sometimes locate is faster, so I usually use locate first.
locate is different from find: find searches on the hard disk, while locate only searches in the /var/lib/slocate database. The speed of locate is faster than find. It does not really search, but checks the database.
Some systems may not have locate and you need to install it yourself. For example, Ubuntu can be installed by entering the following command:
apt-get update apt-get install mlocate
locateThe command to find files is very simple:
lcoate file_name
(2)find
The find command can search by name, type, owner, size, etc.
Basic syntax for searching files:
find path -option file_name
If you use the name to search for the stdio.h file:
find / -name stdio.h
3. Command line editing skills
We mistakenly entered some relatively long content into the terminal:
it@weijishu:~$ dsfdsfdddddddddddddddddddddddddddddddddddfsgadgdsgasdgsdhfdkshfkjdshflksdhfkldshfkj
How to delete it faster? Frantically pressing the backspace key certainly does the trick. But there is a faster way:
Enter the shortcut key ctrl u to delete all the content in front of the cursor. In addition, there are several practical and commonly used shortcut keys as follows:
- ctrl k: Delete all content behind the cursor.
- ctrl a: Move the cursor to the beginning.
- ctrl e: Move the cursor to the end.
In addition, the command line also has many practical and uncommon shortcuts. Interested friends can learn them by themselves.
4. Check the pid of a process
Order:
pidof process_name
5. Check the running status of certain processes
The top command can check some information about the process, but there are too many processes running in the system, which is not conducive to us checking the running status of some processes
At this time we can check the running status of the specified process through the following command, for example:
To view the status of the kcalc process, command:
top -p `pidof kcalc`
This is much simpler.
Notice:
The "` sign" here is not a single quotation mark! ! !
This symbol is to the left of the exclamation point! key on the keyboard.
View multiple processes, such as:
top -p `pidof kcalc` -p `pidof test_x86`
In addition to the above tips, there are also practical tips such as the following. They are briefly listed here and will be introduced in detail later.
The above is the detailed content of Take stock of some practical Linux tips. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



What graphics card is good for Core i73770? RTX3070 is a very powerful graphics card with excellent performance and advanced technology. Whether you're playing games, rendering graphics, or performing machine learning, the RTX3070 can handle it with ease. It uses NVIDIA's Ampere architecture, has 5888 CUDA cores and 8GB of GDDR6 memory, which can provide a smooth gaming experience and high-quality graphics effects. RTX3070 also supports ray tracing technology, which can present realistic light and shadow effects. All in all, the RTX3070 is a powerful and advanced graphics card suitable for those who pursue high performance and high quality. RTX3070 is an NVIDIA series graphics card. Powered by 2nd generation NVID

According to news on June 30, Li Auto’s L series models, including L7, L8 and L9, have achieved considerable sales results in their respective price ranges. However, according to the editor’s understanding, Li Auto hopes to further increase sales, and its focus is on the performance of another new car, the Li Li L6. Recently, a blogger allegedly photographed a camouflaged Ideal L6 car in a highway service area. According to the photos taken by the blogger, the camouflaged car suspected to be the Lili L6 is not driving normally, but is parked on a trailer. Compared with the white Weilai SUV next to it, even as the lowest-positioned model in the L series, the Lideal L6 appears to be quite large. It is reported that the Lili L6 is positioned as a medium-sized five-seat SUV. Although these photos don't provide much information about the appearance details

With the continuous development of internationalization, more and more websites and applications need to support multi-language switching functions. As a popular front-end framework, Vue provides a plug-in called i18n that can help us achieve multi-language switching. This article will introduce common techniques for using i18n to implement multi-language switching in Vue. Step 1: Install the i18n plug-in First, we need to install the i18n plug-in using npm or yarn. Enter the following command at the command line: npminst

The out interface refers to the output interface, and the in interface refers to the input interface. The out interface generally represents the audio source line output interface, which is used to connect loads, such as speakers, headphones, etc.; while the in interface generally represents the audio source line input interface, which is used to connect CD players, mobile phones, MP3 players, computers, etc.

As we all know, there are device restrictions on the installation of win11, and restrictions such as uefi startup are set on the CPU. So can the earliest i7 generation install win11? In fact, it is theoretically possible, but installation is not recommended. Can the i7 generation be installed with win11: Answer: The i7 generation can be installed with win11, but if the configuration is too low, it will freeze, so it is not recommended to install win11. 1. Win11 limits the CPU mainly due to the need for uefi startup and tpm2.0 issues. 2. But this will only restrict us from getting update push in the system normally, and will not restrict the PE system. 3. So we only need to use a USB flash drive to download win11 and install win11 in pe. 4. However, when running win11,

According to news on September 6, Intel will launch a new generation of Raptor Lake Refresh processor series this month. The latest news shows that the flagship model of this series, the Core i9-14900K, performed brilliantly in the Geekbench6.1.0 single-core test, achieving a score of 3121. Compared with the previous generation of 13900K, this result has increased by about 6%. In terms of multi-core performance, although it is slightly inferior to the previous generation, it also shows strong computing potential. According to the editor's understanding, the performance of the Core i9-14900K processor benefits from its innovative design. The processor uses 8 P cores and 16 E cores, taking full advantage of the multi-core architecture. It is particularly worth mentioning that this processor also introduces Th

The difference between Mysqlon, in, as, and where Answer: Where query conditions, use on for internal and external connections, as as an alias, in to query whether a certain value creates 2 tables in a certain condition: student, scorestudent: score: whereSELECT*FROMstudentWHEREs_sex=' Male'For example: onSELECT*FROMstudentLEFTJOINscoreonstudent.s_id=score.s_id; combination of on and where: SELECT*FROMstudentLEFTJOINs

If the processor of our computer is an i5 processor, and we want to reinstall the system of the computer, the editor thinks that we should make relevant considerations based on the hardware configuration requirements of the system. Is it better to install win7 or win10 system on i5? . Only the one that suits you in terms of hardware configuration and personal needs is the best. Let’s take a look at what the editor said for details~ I hope it can help you. Is it better to install win7 or win10 system on i5? Answer: It is better to install win10 system on i5 processor now. 1. As far as win7 and win10 systems are currently used by the most users, in fact, the configuration requirements of the two systems are similar. 2. Therefore, in terms of performance, fluency, and applicability, the win10 system is better than win7
