How do i delete var/log files in Ubuntu 16.04

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I want to delete var/log files due to low disk space but cannot find how.



Any help would be appreciated!










share|improve this question









New contributor




Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • If you rm the log files, you may temporarily solve your low disk space issue, but you do realize the log files will be re-created & return... If you have a condition causing these to grow too large, you should be treating the cause, and not its effect (esp. in this way).
    – guiverc
    2 hours ago














up vote
1
down vote

favorite












I want to delete var/log files due to low disk space but cannot find how.



Any help would be appreciated!










share|improve this question









New contributor




Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • If you rm the log files, you may temporarily solve your low disk space issue, but you do realize the log files will be re-created & return... If you have a condition causing these to grow too large, you should be treating the cause, and not its effect (esp. in this way).
    – guiverc
    2 hours ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to delete var/log files due to low disk space but cannot find how.



Any help would be appreciated!










share|improve this question









New contributor




Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I want to delete var/log files due to low disk space but cannot find how.



Any help would be appreciated!







16.04 log






share|improve this question









New contributor




Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 5 hours ago









abu_bua

2,31631021




2,31631021






New contributor




Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 5 hours ago









Hass

63




63




New contributor




Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Hass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • If you rm the log files, you may temporarily solve your low disk space issue, but you do realize the log files will be re-created & return... If you have a condition causing these to grow too large, you should be treating the cause, and not its effect (esp. in this way).
    – guiverc
    2 hours ago
















  • If you rm the log files, you may temporarily solve your low disk space issue, but you do realize the log files will be re-created & return... If you have a condition causing these to grow too large, you should be treating the cause, and not its effect (esp. in this way).
    – guiverc
    2 hours ago















If you rm the log files, you may temporarily solve your low disk space issue, but you do realize the log files will be re-created & return... If you have a condition causing these to grow too large, you should be treating the cause, and not its effect (esp. in this way).
– guiverc
2 hours ago




If you rm the log files, you may temporarily solve your low disk space issue, but you do realize the log files will be re-created & return... If you have a condition causing these to grow too large, you should be treating the cause, and not its effect (esp. in this way).
– guiverc
2 hours ago










2 Answers
2






active

oldest

votes

















up vote
2
down vote













As mentioned, you can delete a specific log file with sudo rm /var/log/<FILENAME> or all of them with sudo rm /var/log/*.



I also found this:
du -h /var/log/ 2>/dev/null > ~/fileinfo to list the size and path of every log file. To view the result you can use cat ~/fileinfo






share|improve this answer










New contributor




Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • No need in this case to use sudo..
    – doug
    3 hours ago










  • thanks @doug changing answer to reflect this
    – Mon Vrai Nom
    3 hours ago

















up vote
0
down vote













1. Open up the terminal



2a. If you are not sure that you want to delete all of the files you can do it one by one



sudo rm /var/log/logfile.log 


2b. or all of them at once



sudo rm /var/log/* 





share|improve this answer


















  • 1




    I would also try to see which file is the biggest and look at the log to see what warning or error is filling up the log and then try to correct it.
    – chili555
    4 hours ago










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Hass is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1077578%2fhow-do-i-delete-var-log-files-in-ubuntu-16-04%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













As mentioned, you can delete a specific log file with sudo rm /var/log/<FILENAME> or all of them with sudo rm /var/log/*.



I also found this:
du -h /var/log/ 2>/dev/null > ~/fileinfo to list the size and path of every log file. To view the result you can use cat ~/fileinfo






share|improve this answer










New contributor




Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • No need in this case to use sudo..
    – doug
    3 hours ago










  • thanks @doug changing answer to reflect this
    – Mon Vrai Nom
    3 hours ago














up vote
2
down vote













As mentioned, you can delete a specific log file with sudo rm /var/log/<FILENAME> or all of them with sudo rm /var/log/*.



I also found this:
du -h /var/log/ 2>/dev/null > ~/fileinfo to list the size and path of every log file. To view the result you can use cat ~/fileinfo






share|improve this answer










New contributor




Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • No need in this case to use sudo..
    – doug
    3 hours ago










  • thanks @doug changing answer to reflect this
    – Mon Vrai Nom
    3 hours ago












up vote
2
down vote










up vote
2
down vote









As mentioned, you can delete a specific log file with sudo rm /var/log/<FILENAME> or all of them with sudo rm /var/log/*.



I also found this:
du -h /var/log/ 2>/dev/null > ~/fileinfo to list the size and path of every log file. To view the result you can use cat ~/fileinfo






share|improve this answer










New contributor




Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









As mentioned, you can delete a specific log file with sudo rm /var/log/<FILENAME> or all of them with sudo rm /var/log/*.



I also found this:
du -h /var/log/ 2>/dev/null > ~/fileinfo to list the size and path of every log file. To view the result you can use cat ~/fileinfo







share|improve this answer










New contributor




Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer








edited 3 hours ago





















New contributor




Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 3 hours ago









Mon Vrai Nom

213




213




New contributor




Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Mon Vrai Nom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • No need in this case to use sudo..
    – doug
    3 hours ago










  • thanks @doug changing answer to reflect this
    – Mon Vrai Nom
    3 hours ago
















  • No need in this case to use sudo..
    – doug
    3 hours ago










  • thanks @doug changing answer to reflect this
    – Mon Vrai Nom
    3 hours ago















No need in this case to use sudo..
– doug
3 hours ago




No need in this case to use sudo..
– doug
3 hours ago












thanks @doug changing answer to reflect this
– Mon Vrai Nom
3 hours ago




thanks @doug changing answer to reflect this
– Mon Vrai Nom
3 hours ago












up vote
0
down vote













1. Open up the terminal



2a. If you are not sure that you want to delete all of the files you can do it one by one



sudo rm /var/log/logfile.log 


2b. or all of them at once



sudo rm /var/log/* 





share|improve this answer


















  • 1




    I would also try to see which file is the biggest and look at the log to see what warning or error is filling up the log and then try to correct it.
    – chili555
    4 hours ago














up vote
0
down vote













1. Open up the terminal



2a. If you are not sure that you want to delete all of the files you can do it one by one



sudo rm /var/log/logfile.log 


2b. or all of them at once



sudo rm /var/log/* 





share|improve this answer


















  • 1




    I would also try to see which file is the biggest and look at the log to see what warning or error is filling up the log and then try to correct it.
    – chili555
    4 hours ago












up vote
0
down vote










up vote
0
down vote









1. Open up the terminal



2a. If you are not sure that you want to delete all of the files you can do it one by one



sudo rm /var/log/logfile.log 


2b. or all of them at once



sudo rm /var/log/* 





share|improve this answer














1. Open up the terminal



2a. If you are not sure that you want to delete all of the files you can do it one by one



sudo rm /var/log/logfile.log 


2b. or all of them at once



sudo rm /var/log/* 






share|improve this answer














share|improve this answer



share|improve this answer








edited 5 hours ago









abu_bua

2,31631021




2,31631021










answered 5 hours ago









m_krsic

42329




42329







  • 1




    I would also try to see which file is the biggest and look at the log to see what warning or error is filling up the log and then try to correct it.
    – chili555
    4 hours ago












  • 1




    I would also try to see which file is the biggest and look at the log to see what warning or error is filling up the log and then try to correct it.
    – chili555
    4 hours ago







1




1




I would also try to see which file is the biggest and look at the log to see what warning or error is filling up the log and then try to correct it.
– chili555
4 hours ago




I would also try to see which file is the biggest and look at the log to see what warning or error is filling up the log and then try to correct it.
– chili555
4 hours ago










Hass is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















Hass is a new contributor. Be nice, and check out our Code of Conduct.












Hass is a new contributor. Be nice, and check out our Code of Conduct.











Hass is a new contributor. Be nice, and check out our Code of Conduct.













 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1077578%2fhow-do-i-delete-var-log-files-in-ubuntu-16-04%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke