Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Ease of use "Explain Shell" script to understand Shell command     - Machine Learning: Classification of the curse of dimensionality (Programming)

- How to find the available network adapter on Ubuntu (Linux)

- Ubuntu 14.04 / 14.10 how to install Mate 1.10.0 (Linux)

- Linux command in the dialog whiptail (Linux)

- Oracle Client Easy Connection error ORA-12154, TNS-03505 (Database)

- Android Studio 1.0.2 set the memory size (Linux)

- Swift notes - let you two hours to learn Swift (Programming)

- Linux signal and orphans, and zombie process (Programming)

- Java memory area and memory overflow exception (Programming)

- How to Install lightweight Budgie desktop on Ubuntu 14.04 (v8) (Linux)

- Linux Thread Synchronization (Programming)

- httpd-2.4 feature (Server)

- CentOS 6.5 installation and simple configuration Nginx (Server)

- CentOS 6.5 platform offline compile and install PHP5.6.6 (Server)

- GCC and gfortran write MEX program (Matlab2012a) under Ubuntu 14.04 (Programming)

- A process of how to get the current traffic in GNU Linux (Linux)

- stat Usage: Get permission to file the corresponding figures (Linux)

- Linux system with a firewall to prevent the DOS attack (Linux)

- Ubuntu users install the video driver Nvidia Driver 334.21 (Linux)

- Python implementation Bursa transition model (Programming)

  Ease of use "Explain Shell" script to understand Shell command
  Add Date : 2016-07-10      
  We work on Linux, everyone will encounter the need to find help when the shell command. Despite the built-in help like man pages, whatis command is helpful, but the output man pages is very long, unless there is a Linux experience, otherwise it is very difficult to get help from a lot of man pages, whereas whatis command output rarely more than one line, it is not enough for beginners.

Explain the Shell command in Linux Shell

Some third-party applications, as we mentioned in the Linux command line user cheat sheet over 'cheat' command. cheat is a good application, even if the computer does not have Internet can also provide help on shell commands, but it is limited to predefined commands.

Jackson wrote a piece of code, it is very effective to explain shell command inside the bash shell, probably the most beautiful place that you do not need to install third-party package. He put the file that contains the code named "explain.sh".

Characteristics explain.sh tools

Easy to embed code.
No need to install third-party tools.
Output right information in the interpretation process.
It requires a network connection to work.
Pure command-line tool.
You can explain most of the bash shell inside shell commands.
Without using the root account.

The only condition is that 'curl' package. In today's most Linux distributions which have been pre-installed curl package if you can not be installed in accordance with the following commands.

# Apt-get install curl [On Debian systems]
# Yum install curl [On CentOS systems]
Installation explain.sh tool on Linux

We want to insert the following code '~ / .bashrc' file (LCTT Annotation: If the file can not their new one) in. We want to insert the code for each user and the corresponding '.bashrc' file, but it is recommended that you do not add the root user.

We note that the first line of the file .bashrc code (#) beginning, this is optional and only to distinguish the rest of the code.

Start # explain.sh markup code, we will insert the code at the bottom .bashrc file.

# Explain.sh begins
explain () {
if [ "$ #" - eq 0]; then
while read -p "Command:" cmd; do
curl -Gs "https://www.mankier.com/api/explain/?cols=" $ (tput cols) - data-urlencode "q = $ cmd"
echo "Bye!"
elif [ "$ #" - eq 1]; then
curl -Gs "https://www.mankier.com/api/explain/?cols=" $ (tput cols) - data-urlencode "q = $ 1"
echo "Usage"
echo "explain interactive mode."
echo "explain 'cmd -o | ...' one quoted command to explain it."
Use explain.sh tools

After inserting the code and save it, you must exit your current session and log in again to make the changes to take effect (LCTT Annotation: You can also use the command source ~ / .bashrc to make the changes to take effect). Everything is by the 'curl' command processing, which is responsible to explain the commands and command options sent to mankier service, and then print the necessary information to the Linux command line. Needless to say is that you always need to use this tool to connect to the network.

Let explain.sh test script commands do not know the author of several examples.

1. I forgot 'du -h' is doing, I just do this:

$ Explain 'du -h'

Du command to get help

2. If you forgot the 'tar -zxvf' role, you can do so simply:

$ Explain 'tar -zxvf'

Tar command help

3. One of my friends often 'whatis' and 'whereis' command uses confused, so I suggested that he:

In the end a simple Qiaoxia explain command to enter interactive mode.

$ Explain
Then one by one, enter the command, you can see their respective roles in a window:

Command: whatis
Command: whereis

Help Whatis / Whereis command

You only need to use "Ctrl + c" will be able to exit the interactive mode.

4. You can request through the pipeline explain more commands.

$ Explain 'ls -l | grep -i Desktop'

Get the help of multiple commands

Similarly, you can ask your shell to interpret any shell commands. Premise is that you need an available network. Output information is to be explained based commands generated from the server, so the resulting output can not be customized.

For me, this is really useful tool, and it has the honor to add my .bashrc file. What are your thoughts on this project? That'll be useful? Its interpretation make you satisfied? Please let me know it!

Please comment below to provide valuable advice to us, and share our love and help us get spread.
- How to install Go1.5 source development environment on Mac (Server)
- Nodejs mysql pool Example (Programming)
- Graphical interface for the CentOS 6.4 installed and connected by remote VNC (Linux)
- httpd-2.4 feature (Server)
- How to monitor network usage by nload in Linux (Linux)
- Linux, modify the hostname (Linux)
- Ubuntu 14.10 / 14.04 how to install Quick Start tool Mutate 2.2 (Linux)
- Sorting Algorithm (1) Quick Sort C ++ implementation (Programming)
- Installation Flow N Play- interface stylized video player on Ubuntu (Linux)
- CentOS 6/7 Series Docker Installation (Linux)
- Use regular expressions to check whether the input box to enter a URL (Programming)
- File permissions under Linux (Linux)
- Python variable type (Programming)
- MongoDB3.0.6 wiredtiger MMAPv1 (Database)
- Oracle 12C modify spfile path (Database)
- Steps to build MPICH2 development environment on CentOS 6.4 (Linux)
- CentOS7 method to upgrade the kernel to 3.18 (Linux)
- Performance comparison Fibonacci recursive and non-recursive (Programming)
- GitLab Installation Guide -Ubuntu 14.04 LTS (Server)
- Docker ecosystem security is gradually maturing (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.