Categories
Server

How to Append Date and Time to Log File in Linux

If we want to get detailed log report, we can store multiple log files with date and time information on the file name 🙂

We can do this command in Linux :

your_command_here > /path_1/path_2/your_log_$(date +"%Y-%m-%d_%H-%M-%S").txt
Categories
Server

How to Create and Extract Tar.gz File in Linux

How to create tar.gz in Linux :

tar -zcvf "archive.tar.gz" "file.sql"
tar -zcvf "archive.tar.gz" "/home/example/public_html/"

How to extract tar.gz in Linux :

tar -zxvf "archive.tar.gz"