raspi-config tool from the command line
Using raspi-config from the Command Line
raspi-config
is a powerful configuration tool for Raspberry Pi that allows you to easily customize various settings. While it provides an interactive menu-driven interface, it can also be used non-interactively from the command line. This tutorial will guide you through using raspi-config
from the CLI.
Basic Syntax
To use raspi-config
from the command line, you need to use the following syntax:
Note that you need to use sudo
because modifying system settings requires root privileges.
Examples
Here are some examples of commonly used raspi-config
commands from the CLI:
Change the Hostname
To set the hostname of your Raspberry Pi, use the following command:
Replace <hostname>
with the desired hostname for your Raspberry Pi.
Example:
Enable/Disable SSH
To enable or disable SSH access on your Raspberry Pi, use the following command:
Use
0
to enable SSHUse
1
to disable SSH
Example:
Change the Time Zone
To set the time zone on your Raspberry Pi, use the following command:
Replace <timezone>
with the desired time zone.
Example:
Change the Locale
To set the locale on your Raspberry Pi, use the following command:
Replace <locale>
with the desired locale.
Example:
Enable/Disable VNC
To enable or disable the VNC server on your Raspberry Pi, use the following command:
Use
0
to enable VNCUse
1
to disable VNC
Example:
Expand Filesystem
To expand the filesystem to fill the entire SD card, use the following command:
Note that this command will immediately start the partition expansion process without any confirmation.
Conclusion
Using raspi-config
from the command line provides a convenient way to automate the configuration of your Raspberry Pi. By using the nonint
option and the appropriate commands, you can easily modify various settings without the need for an interactive menu.
Remember to always use sudo
when running raspi-config
commands, as they require root privileges to modify system settings.
For a complete list of available commands and their usage, you can refer to the raspi-config
documentation or run raspi-config
with the --help
option.
I hope this tutorial helps you effectively use raspi-config
from the command line on your Raspberry Pi!
Last updated
Was this helpful?