• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

How to use BusyBox on Linux

AnonyViet by AnonyViet
January 24, 2023
in Network
0

When using linux, you are probably familiar with the Terminal command line. Some basic commands, such as cd, kill, and echo are built into your shell. Other commands such as ls, mv and cat are part of the core utility package (usually GNU cores). But there are always other options in the open source world, and one of the most interesting is BusyBox.

Join the channel Telegram of the AnonyViet 👉 Link 👈

How to use BusyBox on Linux

What is BusyBox in Linux?

BusyBox is an open source (GPL) project that provides simple implementations of nearly 400 common commands, including ls, mv, ln, mkdir, more, ps, gzip, bzip2, tar, and grep. It also contains a version of the programming language awkeditor sedfile system checker fsckpackage manager rpm and dpkg, and of course, a shell (sh) that provides easy access to all these commands. In short, it contains all the commands necessary for a POSIX system to perform general system maintenance tasks as well as many administrative and user tasks.

In fact, BusyBox even contains an init command that can be launched as PID 1 to serve as the parent process for all other system services. In other words, BusyBox can be used as an alternative to systemd, OpenRC, sinit, init and other launch daemons.

BusyBox is very light, just under 1 MB, so it has gained popularity in embedded, Edge and IoT devices. In the world of containers and cloud computing, BusyBox is also popular as a platform for Linux container images.

Simplify

Part of BusyBox’s appeal is its minimalism. All commands are compiled into a single binary file (busybox) and has only 81 pages but includes nearly 400 commands.

For comparison example, here is the output of the shadow version of useradd –help:

-b, --base-dir BASE_DIR       base directory for home
-c, --comment COMMENT         GECOS field of the new account
-d, --home-dir HOME_DIR       home directory of the new account
-D, --defaults                print or change the default config
-e, --expiredate EXPIRE_DATE  expiration date of the new account
-f, --inactive INACTIVE       password inactivity
-g, --gid GROUP               name or ID of the primary group
-G, --groups GROUPS           list of supplementary groups
-h, --help                    display this help message and exit
-k, --skel SKEL_DIR           alternative skeleton dir
-K, --key KEY=VALUE           override /etc/login.defs
-l, --no-log-init             do not add the user to the lastlog
-m, --create-home             create the user's home directory
-M, --no-create-home          do not create the user's home directory
-N, --no-user-group           do not create a group with the user's name
-o, --non-unique              allow users with non-unique UIDs
-p, --password PASSWORD       encrypted password of the new account
-r, --system                  create a system account
-R, --root CHROOT_DIR         directory to chroot into
-s, --shell SHELL             login shell of the new account
-u, --uid UID                 user ID of the new account
-U, --user-group              create a group with the same name as a user

And here is the BusyBox version of the same command:

-h DIR    Home directory
-g GECOS  GECOS field
-s SHELL  Login shell
-G GRP    Group
-S            Create a system user
-D            Don't assign a password
-H            Don't create home directory
-u UID    User id
-k SKEL   Skeleton directory (/etc/skel)

Is this difference a feature or a limitation, depending on whether you want 20 options or ten options in your commands. For some users and use cases, BusyBox’s minimalism provides just enough of what the user wants. For others, this is a minimal environment for fallback or as a foundation to install more powerful tools like Bash, Zsh, GNU Awk, etc.

How to install BusyBox

On Linux you can install BusyBox using your package manager. For example on Fedora:

$ sudo dnf install busybox

On Debian:

$ sudo apt install busybox

On macOS, use MacPorts or Homebrew. On Windows, use Chocolatey.

You can set BusyBox as a shell with the command chsh --shellfollowed by the link to the BusyBox app sh. I save BusyBox in /lib64, but its location depends on the distribution you have installed.

$ which busybox
/lib64/busybox/busybox
$ chsh --shell /lib64/busybox/sh

Replacing all common commands with BusyBox is a bit more complicated, because most distributions “default” to search specific packages for specific commands. In other words, while it’s technically possible to replace init with BusyBox’s init, your package manager may refuse to let you remove a package containing init for fear you’ll render the system unbootable. There are several distributions built around BusyBox, so this is probably the easiest way to experience a system built around BusyBox.

Try BusyBox

You don’t need to change your shell to BusyBox permanently just to try it. You can launch the BusyBox shell from your current shell:

$ busybox sh
~ $

However, your system still has non-BusyBox versions of commands installed, so to experience BusyBox’s tools you must enter the commands as arguments to the busybox executable:

~ $ busybox echo $0
sh
~ $ busybox ls --help
BusyBox vX.YY.Z (2021-08-25 07:31:48 NZST) multi-call binary.

Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]...

List directory contents

 -1  One column output
 -a  Include entries that start with .
 -A  Like -a, but exclude . and ..
 -x  List by lines
[...]

For the “full” BusyBox experience, you can create symlinks to busybox for each command. This is easier than imagined, as long as you use a for loop:

$ mkdir bbx
$ for i in $(bbx --list); do \
ln -s /path/to/busybox bbx/$i \
done

Add the bind directory to the beginning of your path and launch BusyBox:

$ PATH=$(pwd)/bbx:$PATH bbx/sh

BusyBox is a fun project and an example of the bare minimum of computing. Whether you use BusyBox as a lightweight environment for an antique computer, or use it for an embedded device, to try out a new init system, or just curious, you can give BusyBox a try. .

Also, you should also take a look at the 10 most dangerous Linux commands here.

The article achieved: 5/5 – (100 votes)

Tags: BusyBoxLinux
Previous Post

API Security 101: Injection – AnonyViet

Next Post

DDosify – Website DDoS load testing tool

AnonyViet

AnonyViet

Related Posts

Guide to self -creation socket5 on Ubuntu
Network

Guide to self -creation socket5 on Ubuntu

May 28, 2025
How to create a separate mtproto proxy to use Telegram when blocked
Network

How to create a separate mtproto proxy to use Telegram when blocked

May 25, 2025
Script backup database and website on telegram
Network

Script backup database and website on telegram

May 2, 2025
Create 64GB RAM 16 core for free on Google IDX
Network

Create 64GB RAM 16 core for free on Google IDX

April 13, 2025
What is VPS running Vietnamese software? What is the reason for installing Vietnamese software on VPS?
Network

What is VPS running Vietnamese software? What is the reason for installing Vietnamese software on VPS?

February 17, 2025
Create Ronin wallet to play pixels on VPS Windows
Network

Create Ronin wallet to play pixels on VPS Windows

February 17, 2025
Next Post
DDosify – Website DDoS load testing tool

DDosify - Website DDoS load testing tool

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Instructions for receiving 80GB of free data from VinaPhone from August 15

Instructions for receiving 80GB of free data from VinaPhone from August 15

August 15, 2025
Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 2025
Wowhay.com – The door opens the world of modern knowledge and network culture

Wowhay.com – The door opens the world of modern knowledge and network culture

August 13, 2025
Instructions for receiving 80GB of free data from VinaPhone from August 15

Instructions for receiving 80GB of free data from VinaPhone from August 15

August 15, 2025
Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 2025
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Instructions for receiving 80GB of free data from VinaPhone from August 15

Instructions for receiving 80GB of free data from VinaPhone from August 15

August 15, 2025
Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí mm88 8XBET mm88 trang chủ new88

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí mm88 8XBET mm88 trang chủ new88

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply