BusyBox


1. BusyBox
2. Toybox
3. BusyBox命令
4. 关于Toybox的争议
5. 被取代的命令
6. 更多相关参考

1. BusyBox

https://en.wikipedia.org/wiki/BusyBox
https://zh.wikipedia.org/wiki/BusyBox

Initial release	1999; 20 years ago
Stable release	1.31.1 (October 25, 2019; 4 months ago) 
Repository	git.busybox.net/busybox
Website 	www.busybox.net

BusyBox是一个遵循GPL协议、以自由软件形式发行的应用程序。Busybox在单一的可执行文件中提供了精简的Unix工具集,可运行于多款POSIX环境的操作系统,例如Linux(包括Android)、Hurd、FreeBSD等等。由于BusyBox可执行文件的文件大小比较小,使得它非常适合使用于嵌入式系统。作者将BusyBox称为“嵌入式Linux的瑞士军刀”。

https://wiki.archlinux.org/index.php/BusyBox
BusyBox在单个小型可执行文件中为嵌入式系统提供了许多常见的UNIX实用程序。
注意:不要期望完全的直接替换和兼容性。某些实用程序可能不存在,而对于某些实用程序,则可能缺少选项。
https://wiki.gentoo.org/wiki/Mdev#Emerging_busybox

2. Toybox

https://en.wikipedia.org/wiki/Toybox

Initial release	2006; 14 years ago
Stable release	0.8.2 / October 18, 2019; 4 months ago
Repository	github.com/landley/toybox.git
Website 	www.landley.net/toybox

Toybox是针对嵌入式设备的某些Unix命令行实用程序的免费开源软件实现。其中包括ls,cp,mv和大约150个其他。Toybox项目始于2006年[2],已成为BSD许可的BusyBox替代产品。
Toybox包含在Android 6.0“ Marshmallow” [5]和所有更高的Android版本(即当前所有受支持的Android版本)中,并且还可以在某些其他操作系统上安装。

功能和目标

  • Toybox旨在为GPL许可的BusyBox提供BSD许可的替代产品。
  • Toybox的主要技术设计目标是简单,小巧,快速和符合标准。
  • Toybox与POSIX -2008和LSB 4.1兼容,并不专注于在GNU对应版本中找到每个选项。



Toybox使用许可的 BSD许可进行许可,其中BusyBox使用copyleft的 GNU通用公共许可,导致不同的使用域。
Busybox主要用于copyleft FOSS域,而Toybox主要用于许可项目和商业公司,例如Google的Android ,这是Toybox的明确目标。
从功能上讲,Toybox尚未达到Busybox的水平。从0.7.7版开始,Toybox仅提供Busybox功能的一部分。

3. BusyBox命令

https://zh.wikipedia.org/wiki/BusyBox#命令
https://en.wikipedia.org/wiki/BusyBox#Commands
https://www.busybox.net/downloads/BusyBox.html#commands

名称 分类 描述 Arch/Busybox/Core 替代品
strings C语言编程 查找文件中可打印字符串 Arch  
tar GnU tar tar archiver Arch Busy archivers
echo Shell编程 输出命令参数到标准输出 Busy Core  
sh Shell编程 Shell,标准命令语言解析器 Busy  
sleep Shell编程 延时 Busy Core  
cut Shell编程 选择文本中每行的特定区域 Arch Core  
tee Shell编程 读取标准输入并写入标准输出和文件 Arch Core  
su util-linux substitute user Arch sudo
date 其他 输出日期和时间 Busy Core  
uname 其他 返回系统名 Busy Core  
od 其他 将文件以八进制或其他进制输出 Arch Core hexdump, vim's xxd
sync 文件处理工具 将缓存写入磁盘并清理缓存 Busy Core  
cat 文件系统 连接和输出文件 Arch Busy Core tac, bat
more 文字处理 逐页显示文件 Busy  
less 文字处理 terminal pager Arch terminal pagers
head 文字处理 显示文件开头几行 Arch Core  
tail 文字处理 显示文件结尾 Arch Core  
ls 文件系统 列出目录内容 Arch Busy Core exa, lsd, tree
pwd 文件系统 输出当前目录 Busy Core  
cd 文件系统 改变工作目录 Arch  
find 文件系统 查找文件 Arch  
grep 其他 根据模式搜索文字 Arch Busy  
egrep 其他 接受扩展正则表达式的grep Busy  
fgrep 其他 接受固定字符串模式的grep Busy  
pgrep 其他 look up processes by name or attributes Arch pidof
chmod 文件系统 改变文件权限 Arch Busy Core  
chown 文件系统 改变文件所有者 Arch Core chgrp
dd 文件系统 转换或复制文件 Arch Busy Core  
cp 文件系统 复制文件 Arch Busy Core  
mv 文件系统 移动文件 Arch Busy Core  
rm 文件系统 删除文件或目录 Arch Busy Core shred
touch 文件系统 改变文件访问和修改时间 Busy Core  
mkdir 文件系统 创建目录 Arch Busy Core  
rmdir 文件系统 删除空目录 Arch Busy Core  
vi 文字处理 面向屏幕的可视化编辑器 Busy  
alias 其他 定义或者显示别名 Arch  
ln 文件系统 创建文件链接 Arch Busy Core  
df 文件系统 报告磁盘剩余空间 Arch Busy Core  
du 文件系统 计算磁盘占用空间 Core  
dmesg 文件系统 查看内核信息 Arch Busy systemd journal
mount 文件系统 挂载存储设备 Arch Busy  
umount 文件系统 移除挂载的存储设备 Arch Busy  
lsblk 文件系统 list block devices Arch  
file 文件系统 判断文件类型 Arch  
type 其他 显示命令类型 Arch which
stat Shell 工具 输出给定的索引节点存储的数据 Core  
awk 文字处理 模式扫描和处理语言 Arch Busy nawk, mawk
sed 文字处理 流编辑器 Arch Busy  
zcat 文字处理 显示或连接zip压缩的文件 Busy  
comm 文字处理 按行比较两个已排序文件 Arch Core  
diff 文字处理 比较2个文件 Arch  
iconv 文字处理 转换字符集 Arch recode
sort 文字处理 文本排序 Arch Core  
tr 文字处理 翻译字符 Arch Core  
uniq 文字处理 报告或者删除文件中重复行 Arch Core  
wc 文字处理 字、行字节或者字符计数 Arch Core  
kill 进程管理 结束进程或向进程发信号 Arch Busy pkill, killall
ps 进程管理 报告进程状态 Arch Busy top, htop
nohup 进程管理 运行一个忽略SIGHUP信号的程序 Core  
bg 进程管理 后台运行作业    
fg 进程管理 在前台运行命令    
jobs 进程管理 显示当前会话中任务状态    
free procps-ng display amount of free and used memory Arch  
time 进程管理 定时命令 Arch  
ping     Busy  
watch     Busy  
wget   HTTP或FTP下载工具 Busy  
chroot Shell 工具 转换root(即“/”)文件夹 Core  
cksum 文件系统 计算文件校验和和大小 Core  
md5sum 文本工具 计算/校验文件的 MD5 校验值 Core  
sha1sum 文本工具 计算/校验sha224sum, sha256sum, sha384sum, sha512sum Core  
env 其他 为命令设置环境变量 Core  
lp 文字处理 发送文件到打印机    
pr 文字处理 打印文件 Core  
printf Shell编程 格式化输出 Core  
stty 其他 设置终端选项 Core  
tty 其他 返回用户终端名 Core  
logname 其他 返回当前登陆用户名 Core  
id 其他 返回用户标示符 Core  
users Shell 工具 输出登录到当前主机的用户 Core  
who 系统管理 显示登录用户 Core  
whoami Shell 工具 输出当前用户的有效用户ID Core  
locale 其他 获得本地信息    
localedef 其他 定义本地环境变量    
man 其他 显示系统文档    
ulimit 其他 设置或显示文件限制    
umask 其他 设置或显示文件生成掩码    
make 编程 维护一整套代码库,组织编译    
split 其他 分割文件 Core  
paste 文字处理 合并文件 Core  
csplit 文字处理 基于内容分割文件 Core  
pathchk 文件系统 检验路径名 Core  
basename 文件系统 输入文件完整路径,只返回其文件名 Core  
dirname 文件系统 返回路径的目录 Core  
expand 文字处理 转换跳格为空格 Core  
unexpand 文字处理 转换空格为制表符 Core  
fold 文字处理 回折每行文本到特定宽度 Core  
nl 文字处理 加行号显示文本 Core  

4. 关于Toybox的争议

https://en.wikipedia.org/wiki/Toybox#Controversy
2012年1月,关于创建BSD许可证替代GPL许可的BusyBox项目的提案引起了Matthew Garrett的严厉批评,因为他剥夺了Software Freedom Conservancy组织唯一的版权实施相关工具。发起了基于BusyBox的诉讼的罗布·兰德利(Rob Landley)对此做出了有意的回应,他解释说,这些诉讼并没有使该项目受益,而是导致了公司回避,并表示希望“以任何方式阻止该诉讼”认为合适”。

https://en.wikipedia.org/wiki/BusyBox#Controversy_over_Toybox
由于关于GPLv3/GPLv2讨论的争议,Toybox于2006年初由前Busybox维护者Rob Landley 根据GNU通用公共许可证启动。2011年年底,该项目进入休眠状态后,根据BSD许可证重新获得了许可。2012年1月11日,索尼(Sony)员工蒂姆伯德(Tim Bird)建议创建BusyBox的替代方案,该替代方案不受GNU通用公共许可证的约束。他建议基于休眠的Toybox。2012年1月,关于创建由BSD许可的替代GPL许可的BusyBox项目的提案引起了Matthew Garrett的严厉批评。对于带走的唯一工具相关版权执法的的软件自由水利组。基于BusyBox的诉讼的开始者罗布·兰德利(Rob Landley)回答说,这是有意的,因为他得出的结论是,这些诉讼并没有希望产生积极的结果,他想“以我认为合适的方式”制止诉讼。

5. 被取代的命令

不推荐使用的Linux网络命令及其替代品 (原文及译文)
https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/
https://www.cnblogs.com/sztom/articles/10764994.html

弃用命令 	更换命令
  arp   	ip n (ip neighbor)
ifconfig	ip a (ip addr), ip link, ip -s(ip -stats)
iptunnel	ip tunnel
iwconfig	iw
 nameif 	ip link,ifrename
netstat 	ss,ip route (for netstat -r), ip -s link (for netstat -i), ip maddr (for netstat -g)
 route  	ip r(ip route)

mkfshttps://wiki.archlinux.org/index.php/File_systems#Create_a_file_system
https://wiki.archlinux.org/index.php/Category:Superseded_commands
https://www.archlinux.org/news/deprecation-of-net-tools/
https://wiki.archlinux.org/index.php/Network_configuration#net-tools
https://wiki.archlinux.org/index.php/Network_configuration#Investigate_sockets
https://wiki.archlinux.org/index.php/Network_configuration/Wireless#iw_and_wireless_tools_comparison
https://wireless.wiki.kernel.org/en/users/Documentation/iw/replace-iwconfig
Arch Linux has deprecated net-tools in favor of iproute2.
就像其他网络接口一样,无线接口也由iproute2包中的ip控制。
管理无线连接需要一套基本的工具。使用 network manager 或直接使用以下之一:

Software Package WEXT nl80211 WEP WPA/WPA2 Archiso
wireless_tools wireless_tools Yes No Yes No Yes
iw iw No Yes Yes No Yes
WPA supplicant wpa_supplicant Yes Yes Yes Yes Yes
iwd iwd No Yes Yes Yes Yes


iw and wireless_tools comparison

iw command 描述 wireless_tools command
iw dev wlan0 link 获取链接状态。 iwconfig wlan0
iw dev wlan0 scan 扫描可用的接入点。 iwlist wlan0 scan
iw dev wlan0 set type ibss 将操作模式设置为临时。 iwconfig wlan0 mode ad-hoc
iw dev wlan0 connect your_essid 连接到开放网络。 iwconfig wlan0 essid your_essid
iw dev wlan0 connect your_essid 2432 连接到开放的网络指定通道。 iwconfig wlan0 essid your_essid freq 2432M
iw dev wlan0 connect your_essid key 0:your_key 使用十六进制密钥连接到WEP加密网络。 iwconfig wlan0 essid your_essid key your_key
使用ASCII密钥连接到WEP加密网络。 iwconfig wlan0 essid your_essid key s:your_key
iw dev wlan0 set power_save on 启用省电功能。 iwconfig wlan0 power on

6. 更多相关参考

List of GNU Core Utilities commands
https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands
https://zh.wikipedia.org/wiki/GNU核心工具组命令列表

List of Unix commands
https://en.wikipedia.org/wiki/List_of_Unix_commands
https://zh.wikipedia.org/wiki/Unix实用程序列表

http://www.roesler-ac.de/wolfram/acro/Cmd.htm

https://wiki.archlinux.org/index.php/Core_utilities

https://wiki.archlinux.org/index.php/List_of_applications#See_also

https://www.gnu.org/software/coreutils/manual/coreutils.html
https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html

GNU核心实用程序
https://en.wikipedia.org/wiki/GNU_Core_Utilities
嵌入式系统上的Linux
https://en.wikipedia.org/wiki/Linux_on_embedded_systems
适用于移动设备的Linux
https://en.wikipedia.org/wiki/Linux_for_mobile_devices

原文地址:https://www.cnblogs.com/sztom/p/12501572.html