Open In App

leave Command in Linux with Examples

Last Updated : 09 Oct, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Many times there comes the situation when we want our terminal to remind us to take a break or to do something important or leave the system for some other reason. So in order to do that we have a command in Linux named leave, thisLinux command sets an alarm on your device for the time mentioned. This command is not preinstalled with linux, hence, it needs to be installed before use.

Syntax

leave <option>

here,

  • <option> has to be replaced with the option you use with the command.

Installing leave command

To install the leave command, use the following commands as per your Linux distribution.

In case of Debian/Ubuntu

sudo apt-get install leave

In case of CentOS/RedHat

sudo yum install leave

In case of Fedora OS

sudo dnf install leave

You can confirm the installation of this command by typing,

leave --version

if an error is not returned it means the installation was successful.

Key Options used with the the leave command

Options

Description

[hhmm]

Sets an alarm for the time given in the 24 hour clock

[[+]hhmm]

sets an alarm for after the time given

1. [hhmm]

leave [hhmm]

When using the leave command with this option the hh needs to be changed into the hour (in 24 hour clock) for which you want to set the alarm snd mm needs to be changed with minute at which you want to set the alarm. For example,

Screenshot-from-2024-10-06-20-45-09
use of command with [hhmm] option


In this example, I have changed hhmm to 2130 which is 21:30 in24 hour clock or 9:30 PM in 12 hour clock.

2. [[+]hhmm]

leave [[+]hhmm]

When using the leave command you must replace hh with how many hours (in 24 hour clock) after the current the time you want to set the alarm for and mm with how many minutes (in 24 hour clock) after the current time you want to set the alarm for. For example,

Screenshot-from-2024-10-07-20-02-34
use of command with [[+]hhmm]

In this example, I have changed hhmm to 0115 which has set an alarm for 1:15 after the current time.

For any further doubts use the following command to see the manual for the leave command,

man leave
leave command manual

This command will display the help/manual section of the leave command.

Conclusion

With the use of this simple yet useful command you can continue with your work efficiently while keeping a check on your screen time, mental health. It can help you relieve workload, not overwork yourself and most importantly help you live a healthy life.


Next Article

Similar Reads