#UBUNTU FIND FILES BY DATE HOW TO#
Here I will show you how to rotate the log files with logrotate on Ubuntu 18.04/20.04. Left unchecked, log files can, therefore, grow to consume all of the available partition space on which they reside. To prevent log files from filling up your system completely, the log messages can be rotated, meaning that when a certain threshold has been reached, the old log file is closed and a new log file is opened. $ touch a.txt -r tgs.Log files are intended to retain information about system activities for a reasonable period of time, but system logging daemons provide no means to control the size of log files.
#UBUNTU FIND FILES BY DATE UPDATE#
The following touch command example will update the time-stamp of file a.txt with the time-stamp of tgs.txt file. You can also take a file as a reference, and update the time for other files, so that both file will hold the same time. Copy the Time-stamp from Another File using -r You can also use a string to change the timeĪnother example: $ touch -d " 12:12:12.000000000 +0530" tgs.txtįor developers, touch command will be really helpful when you are working with Makefiles 5. Size: 3 Blocks: 8 IO Block: 4096 regular file Verify the above change using stat command: $ stat tgs.txt It is not possible to set the date beyond January 18, 2038.įor example: $ touch -a -m -t 203801181205.09 tgs.txt If the value of the YY is between 00 and 37, the value of the CC digits is assumed to be 20. If the value of the YY is between 70 and 99, the value of the CC digits is assumed to be 19.