我应该如何浏览终端中可用的所有命令?我希望能够浏览该命令中当前记录的所有命令/文档,man
我该怎么做?
我列出了4000个手册页
那是问题的一半。OP不仅要:
]# apropos -s1
apropos what?
]# apropos -s1 -w \*
这给出了一个完整的命令列表。但是内建函数,coreutils和sbin呢?
而且,他并不是想要单独的命令:
“所有命令/文档”
许多重要信息位于其他部分:4、5、7或8。
没有起点。没有带有命令列表的“用户手册”。手册是命令列表,命令也仅是构建块。echo
并gcc
有很多解释。但是,对于新手来说,要弄清楚它们的用途并不容易。(我的榜样新手只是一个感兴趣的13岁男孩-或女孩)
制作Linux发行版的方式软件包应该是主要的结构名称:它们自然地将一些命令组合在一起。并且软件包始终具有良好的描述。
这是来自systemd的一些man文件,而不是以“ systemd-”开头的
systemd /usr/share/man/man5/udev.conf.5.gz
systemd /usr/share/man/man5/[email protected]
systemd /usr/share/man/man5/user.conf.d.5.gz
systemd /usr/share/man/man5/[email protected]
systemd /usr/share/man/man5/vconsole.conf.5.gz
systemd /usr/share/man/man7/
systemd /usr/share/man/man7/bootup.7.gz
systemd /usr/share/man/man7/daemon.7.gz
systemd /usr/share/man/man7/file-hierarchy.7.gz
systemd /usr/share/man/man7/hwdb.7.gz
systemd /usr/share/man/man7/kernel-command-line.7.gz
systemd /usr/share/man/man7/sd-boot.7.gz
systemd /usr/share/man/man7/udev.7.gz
systemd /usr/share/man/man8/
systemd /usr/share/man/man8/kernel-install.8.gz
和man1部分:
systemd /usr/share/man/man1/
systemd /usr/share/man/man1/bootctl.1.gz
systemd /usr/share/man/man1/busctl.1.gz
systemd /usr/share/man/man1/coredumpctl.1.gz
systemd /usr/share/man/man1/hostnamectl.1.gz
systemd /usr/share/man/man1/init.1.gz
systemd /usr/share/man/man1/journalctl.1.gz
systemd /usr/share/man/man1/localectl.1.gz
systemd /usr/share/man/man1/loginctl.1.gz
systemd /usr/share/man/man1/machinectl.1.gz
systemd /usr/share/man/man1/networkctl.1.gz
systemd /usr/share/man/man1/portablectl.1.gz
systemd /usr/share/man/man1/resolvectl.1.gz
systemd /usr/share/man/man1/systemctl.1.gz
systemd /usr/share/man/man1/timedatectl.1.gz
这是与内容无关的紧凑概述。
其他重要的软件包是coreutils,util-linux,shell,编辑器。
如果我想了解与相关的其他命令ps
,可以从它的软件包(摘录)中查看其他命令:
procps-ng /usr/share/man/man1/ps.1.gz
procps-ng /usr/share/man/man1/pwdx.1.gz
procps-ng /usr/share/man/man1/slabtop.1.gz
procps-ng /usr/share/man/man1/tload.1.gz
procps-ng /usr/share/man/man1/top.1.gz
描述为“用于监视系统及其过程的实用程序”,它为整个帮派提供了有意义的标题。
20个包(每个包20个手册页)(平均)要比4000个完整手册页要好得多。
我确实对发现的syscall-definitions做了类似的事情(使用find / grep)。
的find -exec grep
是(略格式化上两行):
]# dlist='kernel mm fs block net ipc security'
]# find $dlist -name '*.c' -exec grep '^SYSCALL_DEFINE[0-6]' {} +
该$dlist
是可选的,但全千兆(drivers/
!)会挑起SSD几秒钟的第一次。
通过附加到重定向到某个文件,> /tmp/SYSC_06
我得到了一个列表,该列表可以grep,按dir,文件名和参数数量排序和分组。一些简单的示例如下:
]# grep '(.*write.*,' SYSC_06
mm/process_vm_access.c:SYSCALL_DEFINE6(process_vm_writev, pid_t, pid,
fs/read_write.c:SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf,
fs/read_write.c:SYSCALL_DEFINE4(pwrite64, unsigned int, fd, const char __user *, buf,
fs/read_write.c:SYSCALL_DEFINE3(writev, unsigned long, fd, const struct iovec __user *, vec,
fs/read_write.c:SYSCALL_DEFINE5(pwritev, unsigned long, fd, const struct iovec __user *, vec,
fs/read_write.c:SYSCALL_DEFINE6(pwritev2, unsigned long, fd, const struct iovec __user *, vec,
]# grep sync SYSC_06
mm/msync.c:SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
fs/sync.c:SYSCALL_DEFINE0(sync)
fs/sync.c:SYSCALL_DEFINE1(syncfs, int, fd)
fs/sync.c:SYSCALL_DEFINE1(fsync, unsigned int, fd)
fs/sync.c:SYSCALL_DEFINE1(fdatasync, unsigned int, fd)
fs/sync.c:SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes,
fs/sync.c:SYSCALL_DEFINE4(sync_file_range2, int, fd, unsigned int, flags,
这将更加合乎情理:
fs/sync.c: sync()
fs/sync.c: syncfs(fd)
“也请参阅”很有用,但我想在逻辑组中“请参阅全部”
man futex
具有:
还请参见:get_robust_list(2),restart_syscall(2),...
但我得到:
]# grep futex SYSC_06
kernel/futex.c:SYSCALL_DEFINE2(set_robust_list, struct robust_list_head __user *, head,
kernel/futex.c:SYSCALL_DEFINE3(get_robust_list, int, pid,
kernel/futex.c:SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
(这些行是不完整的...但是请参见上文...搜索也不精确。)
restart_syscall()
仅用于“内部使用”-一条错误的线索。
或所有带有6个参数(最小格式)的syscall:
]# grep FINE6 SYSC_06 |sed -n 's/(/\t\t/p'
kernel/futex.c:SYSCALL_DEFINE6 futex, u32 __user *, uaddr, int, op, u32, val,
kernel/fork.c:SYSCALL_DEFINE6 clone, unsigned long, clone_flags, unsigned long, newsp,
mm/nommu.c:SYSCALL_DEFINE6 mmap_pgoff, unsigned long, addr, unsigned long, len,
mm/mempolicy.c:SYSCALL_DEFINE6 mbind, unsigned long, start, unsigned long, len,
mm/mmap.c:SYSCALL_DEFINE6 mmap_pgoff, unsigned long, addr, unsigned long, len,
mm/process_vm_access.c:SYSCALL_DEFINE6 process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,
mm/process_vm_access.c:SYSCALL_DEFINE6 process_vm_writev, pid_t, pid,
mm/migrate.c:SYSCALL_DEFINE6 move_pages, pid_t, pid, unsigned long, nr_pages,
fs/eventpoll.c:SYSCALL_DEFINE6 epoll_pwait, int, epfd, struct epoll_event __user *, events,
fs/read_write.c:SYSCALL_DEFINE6 preadv2, unsigned long, fd, const struct iovec __user *, vec,
fs/read_write.c:SYSCALL_DEFINE6 pwritev2, unsigned long, fd, const struct iovec __user *, vec,
fs/read_write.c:SYSCALL_DEFINE6 copy_file_range, int, fd_in, loff_t __user *, off_in,
fs/splice.c:SYSCALL_DEFINE6 splice, int, fd_in, loff_t __user *, off_in,
fs/select.c:SYSCALL_DEFINE6 pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp,
fs/aio.c:SYSCALL_DEFINE6 io_pgetevents,
net/socket.c:SYSCALL_DEFINE6 sendto, int, fd, void __user *, buff, size_t, len,
net/socket.c:SYSCALL_DEFINE6 recvfrom, int, fd, void __user *, ubuf, size_t, size,
ipc/syscall.c:SYSCALL_DEFINE6 ipc, unsigned int, call, int, first, unsigned long, second,
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句