Summary of ten Linux command aliases that can improve efficiency

Summary of ten Linux command aliases that can improve efficiency

Preface

Engineers working in the Linux environment will surely be impressed by those cumbersome instructions and parameter command lines. What's scary is not the tediousness, but the need to repeatedly enter these tedious commands.

In Linux, we have an alias command, which can customize those cumbersome commands into aliases that are easy for us to remember, which can greatly improve our efficiency.

However, the alias command is only valid for the current terminal. When the terminal is closed, all the aliases we set will become invalid. So if we want these aliases to be permanent, we need to add them to the .bash_profile file.

In this article, Liang Xu will introduce 10 very practical command aliases that can improve your work efficiency.

1. Compressed files, especially tar files, are widely used in Linux, but the tar command has many options and is not easy to remember. So we can define several commonly used options as an alias untar, so that when we need to decompress the tar file, we can directly use untar filename.

alias untar='tar -zxvf '

2. When we are downloading a large file, the network is suddenly interrupted. Wouldn’t it be frustrating if we have to download it again? Don't worry, our wget command has a -c option that supports breakpoint downloads, and we can also set it as an alias:

alias wget='wget -c '

3. Sometimes we need to generate a 20-character random password. We can use the openssl command, but the complete command is very long and inconvenient. We can set an alias:

alias getpass="openssl rand -base64 20"

4. After downloading a file, we want to verify its checksum value. We can encapsulate this command as an alias sha, and then we can verify the checksum value of the file by sha filename.

alias sha='shasum -a 256 '

5. Under normal circumstances, the ping command will output infinitely, but it doesn’t really make sense. We can use the -c command to limit it to 5 outputs, and then set it as an alias ping. When using it, just ping the URL.

alias ping='ping -c 5'

6. If we want to start a web server anytime and anywhere, we can use this alias:

alias www='python -m SimpleHTTPServer 8000'

7. Network speed testing is also often used in work, but Linux does not have its own command available. We can use the third-party tool speedtest-cli. This tool can be downloaded directly from Github, and the usage is also described in detail. We need to first use the speedtest-cli command to select the server closest to us, and then set the following alias:

alias speed='speedtest-cli --server 2406 --simple'

8. What is your public IP? Those with a good memory can memorize it directly, but what if you have 10 or hundreds of servers? You can also memorize it and then participate in the Brainiest Contest. In fact, there is a command that can query directly, but that command is too abnormal and difficult to remember, so I decisively set it as an alias.

alias ipe='curl ipinfo.io/ip'

9. How do I know my LAN IP? This command is also abnormal, decisively setting an alias.

alias ipi='ipconfig getifaddr en0'

10. Finally, to clear the screen, we can use the ctrl + l shortcut key, or we can define the clear command shorter, which is more direct and rough to use.

alias c='clear'

You may not be able to use all of these 10 commands, because everyone uses Linux in different ways and has different work content. There must be a lot of complex and tedious commands in your work field that can be defined as aliases. You are welcome to add them in the comment area!

Summarize

This concludes this article about ten Linux command aliases that can improve efficiency. For more relevant Linux command aliases, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Linux command to decompress rpm package and introduction to rpm command usage
  • Extract specific file paths in folders based on Linux commands
  • The difference and usage of Ctrl+z, Ctrl+c and Ctrl+d in Linux commands
  • Example code of Linux command to create date folder or file
  • How to save command output to a file in Linux terminal
  • The most comprehensive collection of commonly used Linux commands (with examples)

<<:  mysql replace part of the field content and mysql replace function replace()

>>:  Vue Getting Started with Weather Forecast

Recommend

Comparison of CSS shadow effects: drop-Shadow and box-Shadow

Drop-shadow and box-shadow are both CSS propertie...

Solve the problem of Navicat for Mysql connection error 1251 (connection failed)

Because what I wrote before was not detailed enou...

MySQL Index Optimization Explained

In daily work, we sometimes run slow queries to r...

uni-app implements NFC reading function

This article shares the specific code of uni-app ...

Drop-down menu and sliding menu design examples

I found a lot of websites that use drop-down or sl...

Detailed explanation of the use of state in React's three major attributes

Table of contents Class Component Functional Comp...

Detailed installation instructions for the cloud server pagoda panel

Table of contents 0x01. Install the Pagoda Panel ...

Implementation of Nginx load balancing/SSL configuration

What is load balancing? When a domain name points...

Why does your height:100% not work?

Why doesn't your height:100% work? This knowl...

Linux common basic commands and usage

This article uses examples to illustrate common b...

A Brief Analysis of MySQL PHP Syntax

Let's first look at the basic syntax of the c...

How to implement the singleton pattern in Javascript

Table of contents Overview Code Implementation Si...

Zookeeper unauthorized access test problem

Table of contents Preface Detect Zookeeper servic...

Specific use of lazy loading and preloading in js

Delayed loading (lazy loading) and preloading are...