In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
The Linux alias command is used to set the alias of the instruction. Users can use alias to customize the alias of the instruction. If you enter only alias, you can list all current alias settings. The validity of alias is only limited to the login operation. To set the alias automatically every time you log in, you can set the alias of the instruction in .profile or .cshrc.
Engineers working in Linux must be impressed by the tedious command lines of instructions and parameters. Moreover, the scary thing is not tedious, but the need to re-enter a large number of these cumbersome commands.
Under Linux we have an individual name command alias, which can customize those tedious commands to aliases that we can easily remember, which can greatly improve our efficiency.
However, the alias command is only valid for the current terminal, and when the terminal is closed, all aliases we set are invalid. So if we want these aliases to last forever, we need to add them to the .bash _ profile file.
In this article, Liangxu will introduce 10 command aliases that are very practical and can improve your productivity.
1. Compressed package files, especially tar files, are widely used under Linux, but there are many options for the tar command, which are difficult to remember. So we can define several commonly used options as an alias untar, so that when we need to extract the tar file, we can simply untar filename it.
Alias untar='tar-zxvf'
2. When we were downloading a large file, suddenly the network was abnormally interrupted. Are we crazy to download it again? Don't worry, our wget command has a-c option that supports breakpoint downloads, or we can set it as an alias:
Alias wget='wget-c'
3. Sometimes we need to generate a 20-character random number 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 sha filename can verify the checksum value of the file.
Alias sha='shasum-a 256'
5. Normally, the ping command will be output an unlimited number of times, but it doesn't make much sense. We can use the-c command to limit it to five outputs, then set it to the alias ping, and when using it, ping url.
Alias ping='ping-c 5'
6. If we want to start a web server anytime, anywhere, we can use this alias:
Alias www='python-m SimpleHTTPServer 8000'
7. Network speed testing is also often used at work, but Linux does not have its own commands available, so we can use the third-party tool speedtest-cli. This tool can be downloaded directly from Github and is described in detail in how to use it. We need to first use the speedtest-cli command to select the closest server to us, and then set the following alias:
Alias speed='speedtest-cli-server 2406-simple'
8. What is your public network IP? If you have a good memory, you can memorize it directly, but what if you have 10 servers on 100 servers? You can also memorize it and participate in the strongest brain. In fact, there is a command that can be queried directly, but that command is too abnormal to remember, so it is decisively set as an alias.
Alias ipe='curl ipinfo.io/ip'
9. How to know your own local area network IP? This command is also perverted, decisively setting aliases.
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 makes it more direct and rough to use.
Alias clockwise clear'
You may not be able to use all of these 10 commands, because people use Linux in different directions and work in different ways.
These are the details of 10 Linux command aliases that can improve efficiency. Please pay attention to other related articles for more!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.