Atlas - 03-command-line.md
Home / doc / linux-ref / docs / chapters / 01-kernel Rendered HTML view | Size: 5048 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]The Linux Command Line
The Linux command line is a way to reconfigure parts of the kernel without having to fully recompile it.
Editing the command line
sudo virsh net-start default You can view your current command line with the following command:
bash cat /proc/cmdline/proc/cmdline
[root@arch blix]# cat /proc/cmdline BOOT_IMAGE=/vmlinuz-linux root=UUID=2d53026e-e884-4578-89eb-0766c74f6e71 rw zswap.enabled=0 rootfstype=ext4 loglevel=3 quiet [root@arch blix]#The command line is made up of a series of parameters that are separated by a space. Some parameter have a value, and some are just flags.
Updating the command line in GRUB
In this manual we wont go over every single bootloader but for more information you can look at this page on the ArchWiki about editing the command line
Non-persistent changes
When in the GRUB menu, hover over the entry you want to edit and press
eto edit it. This will bring up a simple text editor where you can edit the GRUB configuration.Look for the line that starts with
linux, it will be quite long and you can pressendon thelinuxline to jump to the end of it. Lets add thesplashparameter to the end of the line. To boot this configuration pressctrl + xorF10.You should now either see a blank screen where you would normally see the boot messages, or you should see a splash screen if your distribution has one.
Now cat out the command line again and you should see that the
splashparameter has been added to the command line.Making changes persistent
In your booted system use
vimornanoto edit the file/etc/default/grub. Look for the line:
GRUB_CMDLINE_LINUX_DEFAULT=In there you can append or edit kernel configuration parameters. To then install this configuration use
grub-mkconfig:
bash sudo grub-mkconfig -o /boot/grub/grub.cfgUpdating the command line in systemd-boot
Editing command line parameters in systemd-boot is similar to GRUB but you will need to edit the entry in the
/bootfolder.Non-persistent changes
When in the systemd-boot menu, hover over the entry you want to edit and press
eto edit it.Making changes persistent
Edit the file
/boot/loader/entries/arch.confand add the parameters you want to the end of theoptionsline. Then save the file and reboot.Hijacking the command line
Without using your bootloader, you can force the command line to be something else. This is done by forcing the
/proc/cmdlinefile to use a mounted file instead of the real command line.``` cp /proc/cmdline /tmp/cmdline
Then edit it as desired
mount --bind /tmp/cmdline /proc/cmdline ```
Note: This will only change the command line for the user space processes, the kernel will still use the original command line that is in memory.
Kernel boot parameters
Below is a short list of boot related parameters as a quick guide:
init: This parameter specifies the initial program that the kernel should run after fully booting. By default, this is usually set to/sbin/init.initrd: This parameter specifies the initial RAM disk (initrd) image that the kernel should use during the boot process.cryptdevice: This parameter is used to specify the encrypted block devicedebug: Enable kernel debugging messages during boot.lsm: Set the initialization order of the Linux Security Modules (LSMs).maxcpus: Limit the number of CPUs that the SMP kernel will use during boot.mem: Force a specific amount of memory to be used.netdev: Network devices configuration.nomodeset: Disable kernel mode setting.panic: Time before automatic panic reset.quiet: Hide kernel logs during boot.splash: Enable splash screen during boot.resume: Specify a swap device for hibernation resume.ro: Mount the root filesystem as read-only during boot.rw: Mount the root filesystem as read-write during boot.root: The root filesystem to use and mount on boot.rootflags: Additional flags for the root filesystem.systemd.unit: Boot to a specified systemd target instead of the default.video: Set the framebuffer configuration.A deep dive into the Kernel Command Line
This section is a work in progress and may be incomplete
Kernel startup subsystem
Audit
audit=<integer {0|1}>Enable the kernel audit subsystem.
audit=1: Enable auditing.audit=0: Disable auditing. defaultAudit backlog limit
audit_backlog_limit=<integer>Set the queue limit for the kernel audit subsystem. Defaults to
64.Boot delay
boot_delay=<integer>Delays
printkmessages during the first seconds of boot. This can be useful for debugging and slowing down the boot speed to see what is going on as each hardware component is being initialized.Defaults to
0which means no delay.Boot memory debug
bootmem_debugEnable boot memory debugging.
[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.