Product SiteDocumentation Site

Alternatives to busybox commands

Unlike previous releases of Red Hat Enterprise Linux, Red Hat Enterprise Linux 6 does not include a version of busybox to provide shell commands in the pre-installation and post-installation environments. Table G.1, “Alternatives to busybox commands” contains a list of busybox commands, equivalent ways to implement the same functionality in bash, and the availability of these alternatives in the %pre and %post environments. The table also indicates the exact path to the command, although you do not generally need to specify the path because the PATH environment variable is set in the installation environment.
If a command is only available in %post, the command is running on the target system and its availability therefore depends on whether the package that provides the command is installed. Every command that appears in the "New command or alternative" column of Table G.1, “Alternatives to busybox commands” is available for Red Hat Enterprise Linux 6, although not every command is available on every installed system.
Where a command is listed as unavailable, you might be able to create equivalent functionality with a Python script. The Python language is available to %pre and %post script authors, complete with a set of Python modules ready for use. Therefore, if a particular command is not available to you in the installation environment, we recommend that you use Python as the script language.
Table G.1. Alternatives to busybox commands
Busybox command %pre %post New command or alternative
addgroup no yes /usr/sbin/groupadd
adduser no yes /usr/sbin/useradd
adjtimex no no none
ar no yes /usr/bin/ar
arping yes yes /sbin/arping or /usr/sbin/arping
ash yes yes /bin/bash
awk yes yes /sbin/awk, /sbin/gawk, or /usr/bin/gawk [a]
basename yes yes /bin/bash [b], /usr/bin/basename
bbconfig no no none — this command is a specific to Busybox
bunzip2 yes yes /usr/bin/bunzip2, /usr/bin/bzip2 -d
busybox no no none
bzcat yes yes /usr/bin/bzcat, /usr/bin/bzip2 -dc
cal no yes /usr/bin/cal
cat yes yes /usr/bin/cat
catv no no cat -vET or cat -A
chattr yes yes /usr/bin/chattr
chgrp yes yes /usr/bin/chgrp
chmod yes yes /usr/bin/chmod
chown yes yes /usr/bin/chown
chroot yes yes /usr/sbin/chroot
chvt yes yes /usr/bin/chvt
cksum no yes /usr/bin/cksum
clear yes yes /usr/bin/clear
cmp no yes /usr/bin/cmp
comm no yes /usr/bin/comm
cp yes yes /usr/bin/cp
cpio yes yes /usr/bin/cpio
crond no no none — no daemons available to scriptlets
crontab no yes /usr/bin/crontab
cut yes yes /usr/bin/cut
date yes yes /usr/bin/date
dc no yes /usr/bin/dc
dd yes yes /usr/bin/dd
deallocvt no yes /usr/bin/deallocvt
delgroup no yes /usr/sbin/groupdel
deluser no yes /usr/sbin/userdel
devfsd no no none — Red Hat Enterprise Linux does not use devfs
df yes yes /usr/bin/df
diff no yes /usr/bin/diff
dirname yes yes /bin/bash [c], /usr/bin/dirname
dmesg yes yes /usr/bin/dmesg
dnsd no no none — no daemons available to scriptlets
dos2unix no no sed 's/.$//'
dpkg no no none — no support for Debian packages
dpkg-deb no no none — no support for Debian packages
du yes yes /usr/bin/du
dumpkmap no no none
dumpleases no no none
e2fsck yes yes /usr/sbin/e2fsck
e2label yes yes /usr/sbin/e2label
echo yes yes /usr/bin/echo
ed no no /sbin/sed, /usr/bin/sed
egrep yes yes /sbin/egrep, /usr/bin/egrep
eject yes yes /usr/bin/eject
env yes yes /usr/bin/env
ether-wake no no none
expr yes yes /usr/bin/expr
fakeidentd no no none — no daemons available to scriptlets
false yes yes /usr/bin/false
fbset no yes /usr/sbin/fbset
fdflush no no none
fdformat no yes /usr/bin/fdformat
fdisk yes yes /usr/sbin/fdisk
fgrep yes yes /sbin/fgrep, /usr/bin/fgrep
find yes yes /usr/bin/find
findfs no no none
fold no yes /usr/bin/fold
free no yes /usr/bin/free
freeramdisk no no none
fsck yes yes /usr/sbin/fsck
fsck.ext2 yes yes /usr/sbin/fsck.ext2, /usr/sbin/e2fsck
fsck.ext3 yes yes /usr/sbin/fsck.ext3, /usr/sbin/e2fsck
fsck.minix no no none — no support for the Minix file system
ftpget yes yes /usr/bin/ftp or Python ftplib module
ftpput yes yes /usr/bin/ftp or Python ftplib module
fuser no yes /sbin/fuser
getopt no yes /usr/bin/getopt
getty no no none
grep yes yes /sbin/grep, /usr/bin/grep
gunzip yes yes /usr/bin/gunzip, /usr/bin/gzip -d
gzip yes yes /usr/bin/gzip
hdparm yes yes /usr/sbin/hdparm
head yes yes /usr/bin/head
hexdump no yes /usr/bin/hexdump
hostid no yes /usr/bin/hostid or Python
hostname yes yes /sbin/hostname, /usr/bin/hostname
httpd no no none — no daemons available to scriptlets
hush no no none
hwclock yes yes /usr/sbin/hwclock
id no yes /usr/bin/id or Python
ifconfig yes yes /sbin/ifconfig, /usr/sbin/ifconfig
ifdown no no ifconfig device down
ifup no no ifconfig device up
inetd no no none — no daemons available to scriptlets
insmod yes yes /sbin/insmod, /usr/sbin/insmod
install no yes /usr/bin/install or mkdir/cp/chmod/chown/chgrp
ip yes yes /sbin/ip, /usr/sbin/ip
ipaddr no no ifconfig or ip
ipcalc yes yes /sbin/ipcalc, /usr/bin/ipcalc
ipcrm no yes /usr/bin/ipcrm
ipcs no yes /usr/bin/ipcs
iplink no no ip
iproute no no ip
iptunnel no yes /sbin/iptunnel
kill yes yes /sbin/kill, /usr/bin/kill
killall yes yes /usr/bin/killall
lash no no none
last no yes /usr/bin/last
length no no Python or bash
less yes yes /usr/bin/less
linux32 no no none
linux64 no no none
ln yes yes /sbin/ln, /usr/bin/ln
load_policy yes yes /sbin/load_policy, /usr/sbin/load_policy
loadfont no no none
loadkmap no no none
login yes yes /usr/bin/login
logname no yes /usr/bin/logname
losetup yes yes /usr/bin/losetup
ls yes yes /usr/bin/ls
lsattr yes yes /usr/bin/lsattr
lsmod yes yes /usr/bin/lsmod
lzmacat no yes /usr/bin/lzmadec
makedevs no no /usr/bin/mknod
md5sum yes yes /usr/bin/md5sum
mdev no no none
mesg no yes /usr/bin/mesg
mkdir yes yes /sbin/mkdir, /usr/bin/mkdir
mke2fs yes yes /usr/sbin/mke2fs
mkfifo no yes /usr/bin/mkfifo
mkfs.ext2 yes yes /usr/sbin/mkfs.ext2
mkfs.ext3 yes yes /usr/sbin/mkfs.ext3
mkfs.minix no no none — no support for Minix filesystem
mknod yes yes /usr/bin/mknod
mkswap yes yes /usr/sbin/mkswap
mktemp yes yes /usr/bin/mktemp
modprobe yes yes /sbin/modprobe, /usr/sbin/modprobe
more yes yes /usr/bin/more
mount yes yes /sbin/mount, /usr/bin/mount
mountpoint no no Look at the output of the mount command
msh no no none
mt yes yes /usr/bin/mt
mv yes yes /usr/bin/mv
nameif no no none
nc no yes /usr/bin/nc
netstat no yes /bin/netstat
nice no yes /bin/nice
nohup no yes /usr/bin/nohup
nslookup yes yes /usr/bin/nslookup
od no yes /usr/bin/od
openvt yes yes /usr/bin/openvt
passwd no yes /usr/bin/passwd
patch no yes /usr/bin/patch
pidof yes yes /usr/sbin/pidof
ping yes yes /usr/bin/ping
ping6 no yes /bin/ping6
pipe_progress no no none
pivot_root no yes /sbin/pivot_root
printenv no yes /usr/bin/printenv
printf no yes /usr/bin/printf
ps yes yes /usr/bin/ps
pwd yes yes /usr/bin/pwd
rdate no yes /usr/bin/rdate
readlink yes yes /sbin/readlink, /usr/bin/readlink
readprofile no yes /usr/sbin/readprofile
realpath no no Python os.path.realpath()
renice no yes /usr/bin/renice
reset no yes /usr/bin/reset
rm yes yes /sbin/rm, /usr/bin/rm
rmdir yes yes /sbin/rmdir, /usr/bin/rmdir
rmmod yes yes /sbin/rmmod, /usr/bin/rmmod
route yes yes /sbin/route, /usr/sbin/route
rpm yes yes /usr/bin/rpm
rpm2cpio no yes /usr/bin/rpm2cpio
run-parts no no none
runlevel no no none
rx no no none
sed yes yes /sbin/sed, /usr/bin/sed
seq no yes /usr/bin/seq
setarch no yes /usr/bin/setarch
setconsole no no none
setkeycodes no yes /usr/bin/setkeycodes
setlogcons no no none
setsid no yes /usr/bin/setsid
sh yes yes /sbin/sh, /usr/bin/sh
sha1sum yes yes /usr/bin/sha1sum
sleep yes yes /sbin/sleep, /usr/bin/sleep
sort yes yes /usr/bin/sort
start-stop-daemon no no none
stat no yes /usr/bin/stat or Python os.stat()
strings no yes /usr/bin/strings
stty no yes /bin/stty
su no yes /bin/su
sulogin no yes /sbin/sulogin
sum no yes /usr/bin/sum
swapoff yes yes /usr/sbin/swapoff
swapon yes yes /usr/sbin/swapon
switch_root no yes /sbin/switch_root
sync yes yes /usr/bin/sync
sysctl no yes /sbin/sysctl
tail yes yes /usr/bin/tail
tar yes yes /usr/bin/tar
tee yes yes /usr/bin/tee
telnet yes yes /usr/bin/telnet
telnetd no no none — no daemons available to scriptlets
test no yes /usr/bin/test or [ in bash
tftp no yes /usr/bin/tftp
time no yes /usr/bin/time or Python
top yes yes /usr/bin/top
touch yes yes /sbin/touch, /usr/bin/touch
tr no yes /usr/bin/tr or Python
traceroute no yes /bin/traceroute
true yes yes /usr/bin/true
tty no yes /usr/bin/tty
tune2fs yes yes /usr/sbin/tune2fs
udhcpc no no /sbin/dhclient
udhcpd no no none — no daemons available to scriptlets
umount yes yes /sbin/umount, /usr/bin/umount
uname no yes /bin/uname or Python os.uname()
uncompress no no none
uniq yes yes /usr/bin/uniq
unix2dos no no sed 's/$//'
unlzma no yes /usr/bin/unlzma
unzip no yes /usr/bin/unzip
uptime no yes /usr/bin/uptime or Python reading /proc/uptime
usleep no yes /bin/usleep or Python
uudecode no yes /usr/bin/uudecode or Python
uuencode no yes /usr/bin/uuencode or Python
vconfig yes yes /usr/sbin/vconfig
vi yes yes /usr/bin/vi
vlock no no none
watch no yes /usr/bin/watch
watchdog no no none
wc yes yes /usr/bin/wc
wget yes yes /sbin/wget, /usr/bin/wget
which no yes /usr/bin/which
who no yes /usr/bin/who
whoami no yes /usr/bin/whoami
xargs yes yes /usr/bin/xargs
yes no yes /usr/bin/yes
zcat yes yes /usr/bin/zcat
zcip no no NetworkManager should take care of this

[a] Red Hat Enterprise Linux 6 ships with GNU awk rather than the busybox awk in the installation environment.

[b] GNU bash can provide basename functionality using string manipulation. If var="/usr/bin/command", then echo ${var##*/} gives command.

[c] GNU bash can provide dirname functionality using string manipulation. If var="/usr/bin/command", then echo ${var%/*} gives /usr/bin.