In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about what the efficient Linux command aliases are about. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
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 be valid, 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 that are hard 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'
two。 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 output * times, but it doesn't really 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 join the 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. *, 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 thanks for your reading! This is the end of this article on "what are the efficient Linux command aliases?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.