BusyBox @wiki
- GNU GPL licenses. (copyleft)
-
BusyBox 官網 - The Swiss Army Knife of Embedded Linux.
Command Help 你可以看到 busybox 所支持的 COMMANDS(Currently available applets).
busybox <applet> [arguments...] # or
<applet> [arguments...] # if symlinked
- Busybox 倉庫 嫩絮,官網也有下載丛肢。
strip
Strip command is used mostly in situations where you want to produce a production quality object file which contains minimum required information so that it can be light weight. You can also use it if you don’t want your executable or object file to get reverse engineered.
- 10 Linux Strip Command Examples (Reduce Executable/Binary File Size);
- How to strip executables thoroughly?
- 建議在 /bin 下只存放二進制可執(zhí)行文件剿干,可以統(tǒng)一 strip蜂怎,減少文件大小。其他文件放到 /etc 下置尔。
版本 version and built-in
-
ash
是嵌入系統(tǒng) busybox 標配杠步。其 演進路徑:(sh) Bourne shell -> (ash) Almquist shell -> (dash) Debian Almquist shell -> 從 dash fork 出 ash 到 embedded systems,符合 POSIX 標準。 - 各類 shell 對照幽歼。
-
# /bin/sh --version
BusyBox v1.12.4 (2018-06-20 15:42:22 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands. -
busybox
看版本號
一般地朵锣,/bin/sh 指向 busybox(也在 /bin 下);
busybox | grep -m1 ^ | awk '{print$2}'
即可取出版本 v1.13.4试躏;
busybox 命令執(zhí)行結果的第一行:BusyBox v1.13.4 (2018-07-02 08:54:56 HKT) multi-call binary
猪勇。
安全專家 Adam Katz 在 How to get the first line of a file in a bash script? 文章中的回答盡顯對 grep、awk颠蕴、sed 的嫻熟掌握泣刹。
ls -lF /bin/sh
lrwxrwxrwx 1 510 511 7 Jul 23 09:12 /bin/sh -> busybox*
- # help
Built-in commands:
. : [ [[ alias bg break cd chdir continue echo eval exec exit export false fg hash help jobs kill let local printf pwd read readonly return set shift source test times trap true type ulimit umask unalias unset wait
Linux 內核 和 系統(tǒng)
- LSB(Linux Standard Base)
-
uname -a
print all information
uname -sn
kernel name 和 node hostname。
uname -r
print the kernel release. -
cat /proc/version
查看內核 -
cat /proc/sys/目錄文件...
了解這個目錄下的內容犀被,可以更好的了解 sysctl椅您。 -
date -Iseconds
2018-06-28T18:17:15+0800,在 bash 中可以作為 HTTP 訪問 t 參數(shù)寡键。在 CentOS 6.9 也支持掀泳。 uptime
-
cat /proc/uptime
This file contains two numbers: the uptime of the system (seconds), and the amount of time spent in idle process (seconds).
示例輸出:37601891.24 102994934.46
第一個數(shù)值為系統(tǒng)運行的秒數(shù),第2個數(shù)值為系統(tǒng)空閑秒數(shù)西轩。注意:該示例為4核服務器员舵。 -
cat /proc/stat
文件 /proc/stat 記錄了系統(tǒng)啟動后的累計cpu信息等。
Various pieces of information about kernel activity are available in the
/proc/stat file.
All of the numbers reported in this file are aggregates since the system first booted.
cat /proc/cpuinfo
# cat /proc/cpuinfo
system type : RTL8672
processor : 0
cpu model : 56321
BogoMIPS : 448.92
tlb_entries : 64
mips16 implemented : yes
- cat /proc/meminfo
# cat /proc/meminfo
MemTotal: 21828 kB
MemFree: 1700 kB
Buffers: 1660 kB
Cached: 7424 kB
SwapCached: 0 kB
Active: 5500 kB
Inactive: 6048 kB
Active(anon): 1100 kB
Inactive(anon): 1592 kB
Active(file): 4400 kB
Inactive(file): 4456 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 2696 kB
Mapped: 2332 kB
Slab: 7100 kB
SReclaimable: 768 kB
SUnreclaim: 6332 kB
PageTables: 364 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 10912 kB
Committed_AS: 34720 kB
VmallocTotal: 1048404 kB
VmallocUsed: 688 kB
VmallocChunk: 1047616 kB
tar
--a
參數(shù)
-a, --auto-compress
use archive suffix to determine the compression program.
自動根據(jù)后綴識別壓縮算法藕畔。例如:tar -xavf sapipack.tar.lzma
-
BusyBox 支持 a 參數(shù)马僻,自動識別
BusyBox 支持 a 參數(shù),自動識別
wan側上網:_INTERNET_R_VID_814