Linux中包含的正式程序列表?


28

是否有一个标准,可以参考我的节目(如列表catls)必须包含在Linux呢?


8
busybox --list。开玩笑。
Arthur2e5

8
Linux是内核,它没有命令。为该内核构建的某些软件发行版遵循LSB标准,其他一些遵循Debian策略,大多数没有特别要求。
斯特凡Chazelas

@StéphaneChazelas虽然我同意,但我要说的是遵循Debian策略接近遵循LSB,因为Debian支持LSB(如果不是默认情况下,仍通过lsb软件包)。
muru

2
:@muru Debian的是放弃对LSB lists.debian.org/debian-lsb/2015/09/msg00008.html
derobert

1
从技术上讲,您什么也不能假设,因为Linux-the-kernel在大量嵌入式或半嵌入式上下文中使用,在这些上下文中,完全的shell实用程序将毫无意义地浪费空间。如果您想知道可以在“正常”的Unix兼容的shell环境中安装什么软件,那么我将关注的不是POSIX也不是LSB,而是Debian认为“必需”的一组软件包。许多基本的系统管理工具(例如“ ip”)根本没有标准化。
zwol 2015年

Answers:


39

Linux Standard Base(LSB)具有应用程序列表

[         du        install        mv            strings
ar        echo      install_initd  newgrp        strip
at        ed        ipcrm          nice          stty
awk       egrep     ipcs           nl            su
basename  env       join           nohup         sync
batch     expand    kill           od            tail
bc        expr      killall        passwd        tar
cat       false     ln             paste         tee
chfn      fgrep     locale         patch         test
chgrp     file      localedef      pathchk       tic
chmod     find      logger         pax           time
chown     fold      logname        pidof         touch
chsh      fuser     lp             pr            tput
cksum     gencat    lpr            printf        tr
cmp       getconf   ls             ps            true
col       gettext   lsb_release    pwd           tsort
comm      grep      m4             remove_initd  tty
cp        groupadd  mailx          renice        umount
cpio      groupdel  make           rm            uname
crontab   groupmod  man            rmdir         unexpand
csplit    groups    md5sum         sed           uniq
cut       gunzip    mkdir          sendmail      useradd
date      gzip      mkfifo         seq           userdel
dd        head      mknod          sh            usermod
df        hostname  mktemp         shutdown      wc
diff      iconv     more           sleep         xargs
dirname   id        mount          sort          zcat
dmesg     infocmp   msgfmt         split

其中许多作为POSIX 1003.1-2001标准的一部分包括在内,但以下内容仅在LSB中使用,或者具有 POSIX 不同的规格

ar       echo      hostname       more          sh
at       egrep     install        mount         shutdown
awk      fgrep     install_initd  msgfmt        su
batch    file      ipcrm          newgrp        sync
bc       fuser     ipcs           od            tar
chfn     gettext   killall        passwd        umount
chsh     grep      lpr            patch         useradd
col      groupadd  ls             pidof         userdel
cpio     groupdel  lsb_release    remove_initd  usermod
crontab  groupmod  m4             renice        xargs
df       groups    md5sum         sed           zcat
dmesg    gunzip    mknod          sendmail
du       gzip      mktemp         seq

4
许多“仅来自LSB”程序实际上是来自POSIX。其中包括:awk,grep,ls,sed,sh,xargs(当然);我必须检查ar,at,bc,crontab。可能还有其他人。
Jonathan Leffler

@JonathanLeffler我一定在正则表达式中犯了一个错误。如果可以的话,会修复它。
muru 2015年

NP。我会使用顶级POSIX 2008(2013)页面,或者专门使用实用程序列表。它包含了我提到的所有可能性;我也看到fileipcrmipcsm4patch,和zcat上市公司-这是一个目测操作,而不是列表的形式验证。
乔纳森·莱夫勒



8

从技术上讲,您不能假设会存在任何东西,因为Linux-the-kernel被用于大量的嵌入式或半嵌入式上下文中,在这些上下文中,如果使用完整的Shell实用程序将无谓浪费空间。例如,构建一个物联网设备(其文件系统包含一个引导程序,一个整体内核,一个/sbin/init执行该设备将要做的所有事情的自定义,几个/dev条目,而没有其他东西)并不是没有问题的

POSIX.1-2008“壳牌和实用程序”规范,在穆鲁的回答也挂,意在规范外壳作为一种编程语言。因此,它不包括人们期望在“传统” Unix安装中提供的大多数系统管理工具。不幸的是,这也是System V与BSD之间古老分裂的明显残留痕迹-您在Linux上发现的工具与FreeBSD或OSX或其他工具上的工具不同。因此,同样,没有可靠的基准。

为了说明maru答案中缺少的内容,这是Debian(不稳定)认为是“必需” 的一组软件包官方定义:“仅具有必需软件包的系统可能无法使用,但它们确实具有足够的功能允许系统管理员来引导和安装更多的软件。“),并有助于文件/bin/sbin/usr/bin,或/usr/sbin。标有星号的不仅是“必需的”,还包括“必需的”,这意味着允许其他打包的软件以不依赖于它的形式存在。

base-passwd*            gzip*                   perl-base*
bash*                   hostname*               sed*
bsdutils*               initscripts             sensible-utils
coreutils*              libc-bin*               sysv-rc
dash*                   libpam-modules-bin      sysvinit-utils*
debianutils*            libpam-runtime          tar*
diffutils*              login*                  tzdata
dpkg*                   mawk¹                   util-linux*
e2fsprogs*              mount*                  xz-utils
findutils*              ncurses-bin*
grep*                   passwd

¹awk-the-language是“必需的”,但是sysadmin可以选择是要“ mawk”还是“ gawk”实现。

这些是被视为“重要”同上的软件包。“重要”的官方定义是“一个经验丰富的Unix人发现它失踪会说'到底是怎么回事,foo在哪里?'”:

adduser         cpio            ifupdown        man-db          vim-common
apt             cron            iproute2        procps          vim-tiny
apt-utils       debconf         iputils-ping    rsyslog         wget
aptitude        dmidecode       isc-dhcp-client systemd         whiptail
aptitude-common gnupg           kmod            systemd-sysv
at              gpgv            less            traceroute
bsdmainutils    groff-base      logrotate       udev

请注意,第二组包括重要的系统管理工具(例如ps和)iproute2,以及一些在某些安装中可能完全不需要的工具(例如at和)dmidecode。这两个集合还包含Debian特定的内容,例如dpkgapt

还要注意,这两个集合都不是LSB(或POSIX + XSI)所需功能的超集:缺少以下实用程序:

ar              gencat          lpr             msgfmt          strings
bc              gettext         lsb_release     patch           strip
ed              install_initd   m4              pax             time
file            killall         mailx           remove_initd
fuser           lp              make            sendmail

以上软件包中包含但LSB中未包含的实用程序列表既冗长又乏味,但是无论如何我都将其包括在内,以强调它包括多少个“关键系统管理工具”。

accessdb                        mkhomedir_helper
add-shell                       mklost+found
addgroup                        mkswap
addpart                         modinfo
adduser                         modprobe
agetty                          mountpoint
apropos                         mt-gnu
apt                             namei
apt-cache                       ncal
apt-cdrom                       ncurses5-config
apt-config                      ncursesw5-config
apt-extracttemplates            neqn
apt-ftparchive                  networkctl
apt-get                         newusers
apt-key                         nisdomainname
apt-mark                        nologin
apt-sortpkgs                    nproc
aptitude-create-state-bundle    nroff
aptitude-curses                 nsenter
aptitude-run-state-bundle       nstat
arch                            numfmt
arpd                            oldfind
badblocks                       ownership
base64                          pam-auth-update
bash                            pam_getenv
bashbug                         pam_tally
biosdecode                      pam_tally2
blkdiscard                      pam_timestamp_check
blkid                           partx
blockdev                        perl
bootctl                         perl5.20.2
bridge                          pg
bsd-from                        pgrep
bsd-write                       pic
busctl                          ping
cal                             ping6
calendar                        pinky
captoinfo                       pivot_root
catchsegv                       pkill
catman                          pldd
cfdisk                          pmap
chage                           poweroff
chattr                          preconv
chcon                           printenv
chcpu                           printerbanner
chgpasswd                       prlimit
chpasswd                        ptx
chroot                          pwck
chrt                            pwconv
clear                           pwdx
clear_console                   pwunconv
colcrt                          raw
colrm                           rbash
column                          readlink
cpgr                            readprofile
cppw                            realpath
cron                            reboot
ctrlaltdel                      remove-shell
ctstat                          rename.ul
dash                            reset
debconf                         resize2fs
debconf-apt-progress            resizepart
debconf-communicate             rev
debconf-copydb                  rgrep
debconf-escape                  rmmod
debconf-set-selections          rmt-tar
debconf-show                    routef
debugfs                         routel
delgroup                        rsyslogd
delpart                         rtacct
deluser                         rtcwake
depmod                          rtmon
dhclient                        rtstat
dhclient-script                 run-parts
diff3                           runcon
dir                             runlevel
dircolors                       runuser
dmidecode                       savelog
dnsdomainname                   script
domainname                      scriptreplay
dpkg                            sdiff
dpkg-deb                        select-editor
dpkg-divert                     sensible-browser
dpkg-maintscript-helper         sensible-editor
dpkg-preconfigure               sensible-pager
dpkg-query                      service
dpkg-reconfigure                setarch
dpkg-split                      setsid
dpkg-statoverride               setterm
dpkg-trigger                    sfdisk
dumpe2fs                        sg
e2freefrag                      sha1sum
e2fsck                          sha224sum
e2image                         sha256sum
e2label                         sha384sum
e2undo                          sha512sum
e4defrag                        shadowconfig
eqn                             shred
expiry                          shuf
factor                          skill
faillog                         slabtop
fallocate                       snice
fdformat                        soelim
fdisk                           ss
filefrag                        start-stop-daemon
findfs                          stat
findmnt                         stdbuf
flock                           sulogin
fmt                             sum
free                            swaplabel
fsck                            swapoff
fsck.cramfs                     swapon
fsck.ext2                       switch_root
fsck.ext3                       sysctl
fsck.ext4                       systemctl
fsck.ext4dev                    systemd
fsck.minix                      systemd-analyze
fsck.nfs                        systemd-ask-password
fsfreeze                        systemd-cat
fstab-decode                    systemd-cgls
fstrim                          systemd-cgtop
geqn                            systemd-delta
getent                          systemd-detect-virt
getopt                          systemd-escape
getty                           systemd-hwdb
gpasswd                         systemd-inhibit
gpg                             systemd-machine-id-setup
gpg-zip                         systemd-notify
gpgsplit                        systemd-path
gpgv                            systemd-run
gpic                            systemd-stdio-bridge
groff                           systemd-tmpfiles
grog                            systemd-tty-ask-password-agent
grops                           tabs
grotty                          tac
grpck                           tailf
grpconv                         tarcat
grpunconv                       taskset
gtbl                            tbl
gzexe                           tc
halt                            tcptraceroute.db
hd                              telinit
helpztags                       tempfile
hexdump                         timedatectl
hostid                          timeout
hostnamectl                     tload
hwclock                         toe
i386                            top
iconvconfig                     traceproto.db
ifdown                          traceroute-nanog
ifquery                         traceroute.db
ifup                            traceroute6.db
infotocap                       troff
init                            truncate
insmod                          tset
installkernel                   tune2fs
invoke-rc.d                     tunelp
ionice                          tzconfig
ip                              tzselect
ipcmk                           udevadm
ischroot                        ul
isosize                         uncompress
journalctl                      unix_chkpwd
killall5                        unix_update
kmod                            unlink
last                            unshare
lastb                           unxz
lastlog                         update-alternatives
ldattach                        update-passwd
ldconfig                        update-rc.d
ldconfig.real                   uptime
ldd                             users
less                            utmpdump
lessecho                        vdir
lessfile                        vigr
lesskey                         vim.tiny
lesspipe                        vipw
lexgrog                         vmstat
lft.db                          vpddecode
line                            w.procps
link                            wall
linux32                         watch
linux64                         wdctl
lnstat                          wget
localectl                       whatis
login                           whereis
loginctl                        which
logrotate                       whiptail
logsave                         who
look                            whoami
lorder                          wipefs
losetup                         x86_64
lsattr                          xxd
lsblk                           xz
lscpu                           xzcat
lsipc                           xzcmp
lslocks                         xzdiff
lslogins                        xzegrep
lsmod                           xzfgrep
lspgpot                         xzgrep
lzmainfo                        xzless
mandb                           xzmore
manpath                         yes
mawk                            ypdomainname
mcookie                         zcmp
md5sum.textutils                zdiff
mesg                            zdump
mke2fs                          zegrep
mkfs                            zfgrep
mkfs.bfs                        zforce
mkfs.cramfs                     zgrep
mkfs.ext2                       zic
mkfs.ext3                       zless
mkfs.ext4                       zmore
mkfs.ext4dev                    znew
mkfs.minix                      zramctl

1
全面。我想指出Debian的adduser(和家族)是... Debian的。Arch使用Slackware的,这是非常不同的。我只是命名它,因为它听起来并不特定于Debian,但仍然像ip您前面提到的命令一样。
muru 2015年

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.