Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

clear log

date_range 19-Nov-23

Syntax

content_copy zoom_out_map
clear log filename
<all>

Description

Remove contents of a log file.

Options

filename

Name of the specific log file to delete. Note that the file name cannot contain any special characters, including: ![=;|(){}]

all

(Optional) Delete the specified log file and all archived versions of it.

Required Privilege Level

clear

Output Fields

See file list for an explanation of output fields.

Sample Output

clear log

The following sample commands list log file information, clear the contents of a log file, and then display the updated log file information:

content_copy zoom_out_map
user@host> file list lcc0-re0:/var/log/sampled detail
lcc0-re0:
--------------------------------------------------------------------------
-rw-r-----  1 root  wheel      26450 Jun 23 18:47 /var/log/sampled
total 1

user@host> clear log lcc0-re0:sampled
lcc0-re0:
--------------------------------------------------------------------------

user@host> file list lcc0-re0:/var/log/sampled detail
lcc0-re0:
--------------------------------------------------------------------------
-rw-r-----  1 root  wheel         57 Sep 15 03:44 /var/log/sampled
total 1

Release Information

Command introduced before Junos OS Release 7.4.

footer-navigation