The blog of a SysAdmin

This is a collection of my notes that I most frequently refer back to. Hopefully some of these may come in handy for others. NOTE: I take no responsibility for your systems if you follow these notes. Always do you own research and make sure you understand fully what it is you are doing.

Sunday, 13 August 2017

Empty log file in Linux

If a log file has grown out of control and you want to empty it out, run the following:


cat /dev/null > /Path/To/Log

This overwrites the file with the contents of /dev/null which is nothing
at 03:27
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2021 (7)
    • ►  July (2)
    • ►  March (3)
    • ►  January (2)
  • ►  2020 (5)
    • ►  October (1)
    • ►  September (3)
    • ►  January (1)
  • ►  2019 (10)
    • ►  July (2)
    • ►  June (3)
    • ►  May (3)
    • ►  February (1)
    • ►  January (1)
  • ►  2018 (2)
    • ►  August (1)
    • ►  July (1)
  • ▼  2017 (11)
    • ►  December (3)
    • ▼  August (8)
      • Windows 2012 Remote Desktop or RemoteApp session l...
      • Remotely sending and executing files to Linux servers
      • Changing Linux Network Configuration
      • Empty log file in Linux
      • Exchange 2010 switch all mailboxes over to other s...
      • Users seeing security warning when rebooting CAS s...
      • Exchange 2010 CAS server disk usage
      • Barracuda Web Filter Expert Mode
  • ►  2016 (1)
    • ►  May (1)
  • ►  2015 (11)
    • ►  October (1)
    • ►  September (7)
    • ►  August (3)
  • ►  2013 (1)
    • ►  May (1)
Awesome Inc. theme. Powered by Blogger.