I am writing a pythong program which has command line executions for linux like ls and restart. I want to know how to pass the errors from the command executed to a file so that it becomes a log.
efibootmgr -c -g -L "Debian (EFI stub)" -l '\EFI\debian\vmlinuz' -u 'root=UUID=$UUID ro quiet rootfstype=ext4 add_efi_memmap initrd=\\EFI\\debian\\initrd.img' efibootmgr -c -d /dev/sdb -L "Debian Linux" -l '\EFI\debian\vmlinuz' -u 'root=UUID=1234-ffff-789 ro quiet rootfstype=ext4 add_efi_memmap initrd=\\EFI\\debian\\initrd.img'
`tail -n 1 efiboot.Hz`
vj ALL=(ALL) NOPASSWD: /path/to/the/program