Thursday, January 30, 2014

Useful Linux Commands

How To Truncate Large Files

Many times, we want to truncate some large files because of space it take. In Linux OS, you have few options. The first one will be using truncate utility.
    truncate -s 0 myLargeFile.log
The other one is:
    > myLargeFile.log
The above 2 commands are the same. But the second one cannot be used with sudo.

Rotate Log Files Using logroute Utility


A good explanation can be found here:

The Ultimate Logrotate Command Tutorial with 10 Examples

ls in Windows

echo dir %1 > %systemroot%\system32\ls.bat

No comments:

Post a Comment