Shell/Bash: crontab edit Example


Shell/Bash Example: This is the "crontab edit" Example. compiled from many sources on the internet by

crontab edit

crontab -e		# open user crontab in edit mode
i      			# for insert.  Make your changes
:wq!   			# quit and save
crontab -l		# open user crontab in read mode

edit cron jobs

# crontab -e

change crontab editor

#run command in terminal:

#Then select an option:
Select an editor.  To change later, run 'select-editor'.
  1. /bin/nano        <---- easiest
  2. /usr/bin/vim.tiny
  3. /bin/ed

Choose 1-3 [1]:

how to edit crontab in linux

Step 1 : crontab -e
Step 2 : Select your prefered editor for the file.
Steo 3 : Add the command that you want to execute from cron and save that file.
		Example : 1 0 * * 0 rm /home/jones/*.log > /dev/null 2>&1
Step 4 : check if cron is activate using command
		crontab -l

* Summary: This "crontab edit" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!