Instructions of command-line in Raspi-config

Posted on: Aug 10, 2017 | Author: weibin li

Many friends have used raspi-config tool as it's easy and relatively visible to change the Raspberry Pi configuration.

Howeverif we want to use the command line to run some of the operations directly instead of entering the raspi-config interfacethen how to do it?

We can find some details in this code.

Many commands appear in pairs such as the commands related to hostname.

raspi-config   nonint  get_hostname

"raspi-config nonint get_hostname"  is to get the hostname getting from the current settings

And raspi-config nonint do_hostname%scorresponds to the set hostname

for example: 

We can set to enable I2C via raspi-config nonint get_i2c 00 means open, 1 means off (different commands may be different correspondence).

Some of the current commands are as follows

/* Command strings */
#define GET_CAN_EXPAND "raspi-config nonint get_can_expand"

#define EXPAND_FS "raspi-config nonint do_expand_rootfs"

#define GET_HOSTNAME "raspi-config nonint get_hostname"

#define SET_HOSTNAME "raspi-config nonint do_hostname %s"

#define GET_BOOT_CLI "raspi-config nonint get_boot_cli"

#define GET_AUTOLOGIN "raspi-config nonint get_autologin"

#define SET_BOOT_CLI "raspi-config nonint do_boot_behaviour B1"

#define SET_BOOT_CLIA "raspi-config nonint do_boot_behaviour B2

#define SET_BOOT_GUI "raspi-config nonint do_boot_behaviour B3"

#define SET_BOOT_GUIA "raspi-config nonint do_boot_behaviour B4"

#define GET_BOOT_WAIT "raspi-config nonint get_boot_wait"

#define SET_BOOT_WAIT "raspi-config nonint do_boot_wait %d"

#define GET_SPLASH "raspi-config nonint get_boot_splash"

#define SET_SPLASH "raspi-config nonint do_boot_splash %d"

#define GET_OVERSCAN "raspi-config nonint get_overscan"

#define SET_OVERSCAN "raspi-config nonint do_overscan %d"

#define GET_CAMERA "raspi-config nonint get_camera"

#define SET_CAMERA "raspi-config nonint do_camera %d"

#define GET_SSH "raspi-config nonint get_ssh"

#define SET_SSH "raspi-config nonint do_ssh %d"

#define GET_VNC "raspi-config nonint get_vnc"

#define SET_VNC "raspi-config nonint do_vnc %d"

#define GET_SPI "raspi-config nonint get_spi"

#define SET_SPI "raspi-config nonint do_spi %d"

#define GET_I2C "raspi-config nonint get_i2c"

#define SET_I2C "raspi-config nonint do_i2c %d"

#define GET_SERIAL "raspi-config nonint get_serial"

#define GET_SERIALHW "raspi-config nonint get_serial_hw"

#define SET_SERIAL "raspi-config nonint do_serial %d"

#define GET_1WIRE "raspi-config nonint get_onewire"

#define SET_1WIRE "raspi-config nonint do_onewire %d"

#define GET_RGPIO "raspi-config nonint get_rgpio"

#define SET_RGPIO "raspi-config nonint do_rgpio %d"

#define GET_PI_TYPE "raspi-config nonint get_pi_type"

#define GET_OVERCLOCK "raspi-config nonint get_config_var arm_freq /boot/config.txt"

#define SET_OVERCLOCK "raspi-config nonint do_overclock %s"

#define GET_GPU_MEM "raspi-config nonint get_config_var gpu_mem /boot/config.txt"

#define GET_GPU_MEM_256 "raspi-config nonint get_config_var gpu_mem_256 /boot/config.txt"

#define GET_GPU_MEM_512 "raspi-config nonint get_config_var gpu_mem_512 /boot/config.txt"

#define GET_GPU_MEM_1K "raspi-config nonint get_config_var gpu_mem_1024 /boot/config.txt"

#define SET_GPU_MEM "raspi-config nonint do_memory_split %d"

#define GET_HDMI_GROUP "raspi-config nonint get_config_var hdmi_group /boot/config.txt"

#define GET_HDMI_MODE "raspi-config nonint get_config_var hdmi_mode /boot/config.txt"

#define SET_HDMI_GP_MOD "raspi-config nonint do_resolution %d %d"

#define GET_WIFI_CTRY "raspi-config nonint get_wifi_country"

#define SET_WIFI_CTRY "raspi-config nonint do_wifi_country %s"

#define CHANGE_PASSWD "(echo "%s" ; echo "%s" ; echo "%s") | passwd"

You can try those command on your Raspberry Pi's command line console.

have fun~ 

Comments (0)

No comment

Add a comment

You need to Login to add comments.

Latest Posts

Testing Android things OS on Raspberry Pi
Recently, We were testing android things. and we are going to show you how to start.
on Dec 20, 2017 | by Weibin Li
Our Customer's review tutorial
here is some product like GPS and 5 inch capacitive touch screen and ADC module's tutorial video. please visit link...
on Nov 9, 2017 | by Weibin Li
batocera | Kodi - Your home media center
Kodi If you haven’t heard already, Kodi is available with Batocera. It’s been preinstalled and configured for...
on Aug 29, 2017 | by Weibin Li