Linux command need I say more, who can not a few? However, a command can have dozens of uses. Take ls, the simplest and most commonly used command, for example, which has nearly 20 options
Such as
Ls-a: Realizes all files and their hidden files
Ls -t: sort by creation time
Ls -h: indicates the actual file size
. , etc.
To be honest, there are so many uses, sometimes I just can’t remember. Maybe we choose to go to Google, Baidu. But today I recommend a method to you, the efficiency has been improved a lot.
Man!!!!!! Sounds like a funny name. It’s easy to use.
Enter the command to be queried by man on the terminal
What? How is it in English? Obviously, it is not very friendly for many friends who are not good at English.
So, for Linux and Mac. Here is how to install the Chinese version of MAN!
Mac
If you use a MAC, you must have Homebrew installed. First, install both packages via BREW
brew install automake
brew install opencc
Copy the code
After the installation, download the Chinese package and compile hanzhu Anu. Execute the following commands in sequence!
> git clone https://github.com/man-pages-zh/manpages-zh
> cd manpages-zh
> autoreconf --install --force
> ./configure
> sudo make
> sudo make install
Copy the code
After the installation is complete, re-execute the command we just did, man ls. Why, how is it garbled?
At this point, install Groff via BREW
brew install groff
Copy the code
After installation, edit the file man.conf
sudo vim /etc/man.conf
Copy the code
Add on the last line
NROFF preconv -e UTF8 | /usr/local/bin/nroff -Tutf8 -mandoc -c
Copy the code
Then :Wq save and exit, run the command again, you can display Chinese normally
Linxu
wget https://src.fedoraproject.org/repo/pkgs/man-pages-zh-CN/manpages-zh-1.5.2.tar.bz2/cab232c7bb49b214c2f7ee44f7f35900/manpa Ges - useful - 1.5.2. Tar..bz2Copy the code
Unpack the
The tar - XJF manpages - useful - 1.5.2. Tar..bz2Copy the code
Enter the directory
CD manpages - useful - 1.5.2 /Copy the code
perform
> ./configure --disable-zhtw
> make && make install
Copy the code
To prevent conflicts between the Chinese version and the original version, use a different name cman
echo "alias cman='man -M /usr/local/share/man/zh_CN'" >> /etc/profile.d/cman.sh
Copy the code
And refresh it
source /etc/profile.d/cman.sh
Copy the code
Now that the Chinese version is installed on Linux, type cman ls to see all the usage of ls
Well, in the future, if you can’t remember the command, you can directly query. Is it convenient?
At the end of the article, check out a collection of hundreds of Java ebooks, there’s always the one you need