Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Several commands commonly used in Linux to share

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "several command sharing commonly used in Linux". In daily operation, I believe many people have doubts about several command sharing problems commonly used in Linux. The editor consulted all kinds of information and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "several command sharing commonly used in Linux". Next, please follow the editor to study!

Tldr (Command Manual)

As a developer, terminal commands are often used, but the biggest headache is that I can't remember the tedious parameters. The search efficiency of Googe Duniang is low, and the results displayed by man command are not easy to read.

The tldr command is the solution to this pain point.

What is tldr? Its GitHub page translation is "a concise community-driven help manual", which is the best explanation for it, according to the 28 principles to give examples of common scenarios of commands, easy to read, friends from all over the world can submit content to this command library on Github, it is completely community-driven.

The man command is described in more detail, and from a practical point of view, tldr is the king.

Cdn.xitu.io/2019/3/5/1694b891e998ebf6?w=720&h=534&f=jpeg&s=35279 ">

Tip: it can run in nearly 20 languages and update the local command library through tldr-update.

Tree (tree directory)

When we write project documents, this small command can come in handy if we want to express the project structure and content more visually, arranging directories and files in an image-like tree view.

Tip: support customization levels, filtering content and other personalized settings. View specific usage examples through tldr tree. Add-N parameter to solve the problem of Chinese garbled.

Rlwrap (Historical Command)

Students who often use commands must have a habit of switching historical commands by pressing the up and down keys, but the headache is that telnet commands do not support switching, or even backspace deletion, so they often encounter the following awkward situations. Don't worry, rlwrap is used to solve this pain point.

Execute the Dubbo interface through telnet:

Connect to the memcached server through telnet:

What is rlwrap? It is based on the readline library to achieve command line completion and recording of wrapper commands. Nowadays, interactive input is the most basic requirement. Linux records users' operations through readline, and realizes the functions of interactive input, automatic completion, search and so on. Rlwrap is the best partner for commands that do not support readline operations.

Usage: add the telnet command before executing the rlwrap command.

Tip: in addition to the fact that the telnet command does not support Readline requires rlwrap wrapper, Oracle's sqlplus, rman, asmcmd and other commands can also switch up and down through rlwrap.

Shortcut alias: alias telnet='rlwrap telnet'

Script (record session output)

In many cases, for the sake of security and backup, the work content needs to be saved. Then, the script command is the recorder hidden in the terminal, which can record all the contents of the terminal session and form a file. For students who need to leave a mark on their work, script is a good medicine.

How to use it?

Start it with script, and it has already started recording. When you are done, exit the record with exit, and a file called "typescript" is generated by default.

Tip: in what scenarios can script be used?

1. I need to push a large number of videos to CDN, which takes one night. At this time, the log of execution is recorded through script, and those that are not successfully pushed are processed separately the next day.

2. If someone remotes your server or computer, script it to be safe.

3. When you work with a colleague, you have done half of your work and give it to another person to do it. Send him your script and let him continue.

……

Autojump (direct access with one click)

"the last finale artifact is also one of the most frequently used commands."

I believe that the commands most frequently used by most end users are cd and ls. When I don't know where to switch to, I have to ls to confirm the directory name, so repeatedly, it may take several or even ten times of cd to reach the desired directory, and how much wind and rain it took to find my file. As the saying goes, "programmers who will not be lazy are not good programmers". It is not our style to suffer so many setbacks, so with the birth of autojump, it is destined to be extraordinary.

As the name implies, autojump automatically jumps, rather than switching, because it can be done directly with one click.

Tip: you can view its database through the j-s command, as well as the directory weights in the database.

At this point, the study of "several commands commonly used in Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report