The easy method:
newline=@reboot /usr/bin/numlockx
(crontab -l && echo "$newLine") | crontab -
Alternative (longer version) of adding a line to crontab:
crontab -l > tempCron # copy crontab to a new file
echo "$newLine" >> tempCron #echo new cron into cron file
crontab tempCron # Replace crontab with tempCron
rm tempCron
Original (manual) version of installing numlock:
sudo crontab -e
### add this line ###
echo "@reboot /usr/bin/numlockx" >> /usr/bin/crontab
Categories: