Linux 技术文章中类似func(2)的含义,另http://linux.die.net/man/

本文是http://linux.chinaunix.net/bbs/viewthread.php?tid=1179297&pid=7358736&page=1&extra=#pid7358736上一哥们的回复,再三感谢之..

Linux提供了丰富的帮助手册,当你需要查看某个命令的参数时不必到处上网查找,只要man一下即可。

  Linux的man手册共有以下几个章节:

  1、Standard commands (标准命令)

  2、System calls (系统调用)

  3、Library functions (库函数)

  4、Special devices (设备说明)

  5、File formats (文件格式)

  6、Games and toys (游戏和娱乐)

  7、Miscellaneous (杂项)

  8、Administrative Commands (管理员命令)

  例如:我们输入 man ls,它会在最左上角显示“LS(1)”,在这里,“LS”表示手册名称,而“(1)”表示该手册位于第一节章,同样,我们输入“man ifconfig”它会在最左上角显示“IFCONFIG(8) 也可以这样输入命令:“man [章节号] 手册名称”。

  man是按照手册的章节号的顺序进行搜索的,比如:

  man sleep

  只会显示sleep命令的手册,如果想查看库函数sleep,就要输入:

  man 3 sleep

  Ubuntu man手册完善

  1.添加库函数手册

  Ubuntu默认是没有安装c语言的库函数man手册的,所以你在man perror 和sendto之类的函数时会显示没有相关文档的问题,这个问题让我郁闷了我好久。解决方法:

  sudo apt-get install manpages-dev

  2.让man显示中文

  Ubuntu源里面已经包含了中文的man包,所以不用从其他地方down了,直接

  sudo apt-get install manpages-zh

  但是这样man默认显示的还不是中文,还需要以下两步

  a.把中文man包转换成utf8格式的

  新建一个脚本文件

  gedit t.sh

  把下面内容添加进去

  #!/bin/bashcd /usr/share/man/zh_CN/for k in *docd $kfor i in *.gzdo j=`echo ${i%.gz}` gunzip $i iconv -f gb18030 -t utf8 $j >tmp mv tmp $j gzip $jdonecd ..done

  然后

  sudo ./t

  b.修改man默认的语言

  sudo gedit /etc/manpath.config 把里面的所有的 /usr/share/man 改成 /usr/share/man/zh_CN

  保存后退出,然后你再试一下man ls

  3.让没有中文帮助的显示英文

  做完上面第二部还不够,这时你再man 一下一些c语言函数(不要用printf,socket之类比较有名的函数,这些已经有中文帮助了)的时候就会发现竟然没有帮助,而刚才明明在第一步已经安装了啊。这是因为你上面 把/usr/share/man 改成 /usr/share/man/zh_CN的操作使man只在中文帮助中搜索,如果没有就直接放弃,因此还需要以下操作,才能让man在没有中文帮助的时候自动显示英文的帮助,如果英文的也没有,哪就真的没有了。

  sudo gedit /etc/manpath.config

  然后搜索你刚才改过的地方,然后在其后面添加同样的一行,只是后面的目录还用原来的/usr/share/man,比如在修改后的

  MANPATH_MAP /bin /usr/share/man/zh_CN

  再添加一行

  MANPATH_MAP /bin /usr/share/man

Looking for: ['mfix==25.1.2', 'mfix-solver=25.1.2'] warning libmamba Cache file "/home/ps/miniforge3/pkgs/cache/497deca9.json" was modified by another program warning libmamba Cache file "/home/ps/miniforge3/pkgs/cache/09cdf8bf.json" was modified by another program warning libmamba Could not parse mod/etag header warning libmamba Could not parse mod/etag header warning libmamba Could not parse mod/etag header warning libmamba Could not parse mod/etag header warning libmamba Cache file "/home/ps/miniforge3/pkgs/cache/47929eba.json" was modified by another program warning libmamba Cache file "/home/ps/miniforge3/pkgs/cache/3e39a7aa.json" was modified by another program warning libmamba Cache file "/home/ps/miniforge3/pkgs/cache/2ce54b42.json" was modified by another program warning libmamba Cache file "/home/ps/miniforge3/pkgs/cache/4ea078d6.json" was modified by another program https://mirrors.ustc.edu.cn/anaconda/cloud/menpo.. https://mfix.netl.doe.gov/s3/09d9e2e6/acf3d1bd18.. https://mirrors.ustc.edu.cn/anaconda/cloud/bioco.. https://mfix.netl.doe.gov/s3/09d9e2e6/acf3d1bd18.. https://mirrors.ustc.edu.cn/anaconda/pkgs/main/n.. https://mirrors.aliyun.com/pypi/simple/linux-64 0.4s https://mirrors.ustc.edu.cn/anaconda/pkgs/main/l.. 17.6s https://mirrors.ustc.edu.cn/anaconda/cloud/msys2.. https://mirrors.aliyun.com/pypi/simple/noarch 0.6s Multi-download failed. Reason: Transfer finalized, status: 404 [https://mirrors.aliyun.com/pypi/simple/noarch/repodata.json] 2318 bytes # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "/home/ps/miniforge3/lib/python3.10/site-packages/conda/exceptions.py", line 1132, in __call__ return func(*args, **kwargs) File "/home/ps/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 941, in exception_converter raise e File "/home/ps/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 934, in exception_converter exit_code = _wrapped_main(*args, **kwargs) File "/home/ps/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 892, in _wrapped_main result = do_call(parsed_args, p) File "/home/ps/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 758, in do_call exit_code = create(args, parser) File "/home/ps/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 632, in create return install(args, parser, "create") File "/home/ps/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 499, in install index = load_channels(pool, channels, repos) File "/home/ps/miniforge3/lib/python3.10/site-packages/mamba/utils.py", line 129, in load_channels index = get_index( File "/home/ps/miniforge3/lib/python3.10/site-packages/mamba/utils.py", line 110, in get_index is_downloaded = dlist.download(api.MAMBA_DOWNLOAD_FAILFAST) RuntimeError: Multi-download failed. Reason: Transfer finalized, status: 404 [https://mirrors.aliyun.com/pypi/simple/noarch/repodata.json] 2318 bytes `$ /home/ps/miniforge3/bin/mamba create -n mfix-25.1.2 mfix==25.1.2 mfix-solver=25.1.2 -c conda-forge -c https://mfix.netl.doe.gov/s3/09d9e2e6/acf3d1bd18d1e8d1637bad33e96216d6//conda/dist` environment variables: CIO_TEST=<not set> CONDA_DEFAULT_ENV=base CONDA_EXE=/home/ps/miniforge3/bin/conda CONDA_PREFIX=/home/ps/miniforge3 CONDA_PROMPT_MODIFIER=(base) CONDA_PYTHON_EXE=/home/ps/miniforge3/bin/python CONDA_ROOT=/home/ps/miniforge3 CONDA_SHLVL=1 CURL_CA_BUNDLE=<not set> LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64: LD_PRELOAD=<not set> PATH=/home/ps/miniforge3/bin:/home/ps/miniforge3/condabin:/home/ps/.local/b in:/home/ps/bin:/usr/local/cuda- 12.0/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin REQUESTS_CA_BUNDLE=<not set> SSL_CERT_FILE=<not set> WINDOWPATH=2 active environment : base active env location : /home/ps/miniforge3 shell level : 1 user config file : /home/ps/.condarc populated config files : /home/ps/miniforge3/.condarc /home/ps/.condarc conda version : 23.3.1 conda-build version : not installed python version : 3.10.12.final.0 virtual packages : __archspec=1=x86_64 __cuda=12.2=0 __glibc=2.28=0 __linux=4.18.0=0 __unix=0=0 base environment : /home/ps/miniforge3 (writable) conda av data dir : /home/ps/miniforge3/etc/conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://mfix.netl.doe.gov/s3/09d9e2e6/acf3d1bd18d1e8d1637bad33e96216d6//conda/dist/linux-64 https://mfix.netl.doe.gov/s3/09d9e2e6/acf3d1bd18d1e8d1637bad33e96216d6//conda/dist/noarch http://pypi.douban.com/simple/linux-64 http://pypi.douban.com/simple/noarch https://mirrors.aliyun.com/pypi/simple/linux-64 https://mirrors.aliyun.com/pypi/simple/noarch https://mirrors.ustc.edu.cn/anaconda/cloud/linux-64 https://mirrors.ustc.edu.cn/anaconda/cloud/noarch https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/linux-64 https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/noarch https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/linux-64 https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/noarch https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/linux-64 https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/noarch https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/linux-64 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/noarch https://mirrors.ustc.edu.cn/anaconda/pkgs/free/linux-64 https://mirrors.ustc.edu.cn/anaconda/pkgs/free/noarch https://mirrors.ustc.edu.cn/anaconda/pkgs/main/linux-64 https://mirrors.ustc.edu.cn/anaconda/pkgs/main/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/ps/miniforge3/pkgs /home/ps/.conda/pkgs envs directories : /home/ps/miniforge3/envs /home/ps/.conda/envs platform : linux-64 user-agent : conda/23.3.1 requests/2.31.0 CPython/3.10.12 Linux/4.18.0-348.el8.x86_64 centos/8.5.2111 glibc/2.28 UID:GID : 1000:1000 netrc file : None offline mode : False An unexpected error has occurred. Conda has prepared the above report.
最新发布
07-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值