This is such a crucial folder on your Linux systems. You need be the root user to view or access log files on Linux or Unix like operating systems. If you have long log files which are also quite complicated, then Glogg is the right choice for … If you want to display a limited number of lines use –n and the number of lines you want to display, as shown below. Some of the most known and heavily used utility to display a file content in real time in Linux is the tail command (manage files effectively). Log files are a set of records that Linux maintains for the administrators to keep track of important events. Compressed files: Open a terminal and browse to /var/log. 5 commands to view files in Linux. Here are five commands that let you view the content of a file in Linux terminal. Pingback: linux last login time - Credit One. lnav – An Advanced Console Based Log File Viewer for Linux. Subscribe to our mailing list and get interesting stuff and updates to your email inbox. Perform a list (ls) command to see contents of that directory. About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. To use this command –f is used to follow the content of the file, open up the terminal and type the following command: # sudo tail –f /var/log/apache2/access.log They contain messages about the server, including the kernel, services and applications running on it. Finding the log files on Linux. Hence, adding an example for the same. Pass the filename on the command line and use the -f (follow) option. Log files on Linux systems contain a LOT of information — more than you'll ever have time to view. Hence, handy for examining potential security breaches like login credential hacks and brute-force attacks. eval(ez_write_tag([[580,400],'vitux_com-medrectangle-3','ezslot_0',110,'0','0'])); To view the live output of the file using –F with less command as shown below. tail – If you want to view the content of the log files real time, as the application is writting to it, use “tail -f”. Suggested Read : lnav – An Advanced Console Based Log File Viewer for Linux. Both does the same, but you can choose what you…, This user monitor terminal record script after putting in /etc/profile, Will it effect users .bash_profile. We are going to search errors string from /var/log/messages & /var/log/dmesg file. sudo cat example_error_log. What is the difference between apt and apt-get command? By default the logs in Ubuntu and Linux Mint from CRON execution can be found in: /var/log/syslog. It’s not a easy task to read entire log when you want a specific information. we respect your privacy and take protecting it seriously, 2DayGeek :- Linux Tips, Linux How-to Guides and Tutorials is licensed under a (cc) BY-NC, Best Ways to Find Your Linux Distribution Name and Their Version, cTop – Command Line tool for container monitoring and management in Linux. As you can see, many.gz files in there. View a text file called foo.txt on a Linux or Unix-like systems How to Automatically Record the Terminal Session Activity of All Users on Linux. Please try again. Linux provides a centralized repository of log files that can be located under the /var/log directory. Notice the multiple files in the log file directory with numbers after them. How to Automatically Accept SSH Key Fingerprint? Finally, you can display the live output of a … As said, tail command is the most common solution to display a log file in real time. less Command – Display Real Time Output of Log Files. Usually, the log files are rotated frequently on a Linux server by the logrotate utility. You can look at Linux logs using the cd /var/log command. The tail -F will keep track if new log file being created and will start following the new file instead of the old file. The log files are stored in /var/log … The following format 01/Feb/2018:07:00:00 doesn’t work with sed & awk command. You can use the following commands to see the log files: Log files on Linux systems contain a LOT of information — more than you'll ever have time to view. If you’ve had trouble with a particular program on your Linux PC or server, you’d navigate to the log directory and view all of the files inside. Run the following commands to read the log file when you have the requirement to read the files … /var/log/cron: keeps a record of Crond-related messages (cron jobs). To use this command –f is used to follow the content of the file, open up the terminal and type the following command: As log files are changed apparently. Your email address will not be published. LS will print out a complete list of all log files on the screen. The log files are stored in /var/log directory and its subdirectory. 1) How to read log file between two Dates. A file backup program could use a LOG file too, which could be opened later to review a previous backup job, read through any errors that were encountered, or see where the files were backed up to. In Linux, you can view contents of a compressed .gz file without uncompressing (uncompress on the fly actually or in temp directory) which makes perfect sense for those who deal with large log files … I mean really, really large. If you want to display multiple log files simultaneously use the multitail command. If this condition persists, About running 32 bit programs on 64 bit Ubuntu and shared libraries, apache openmeetings 3.0 installation and configuration in centos 6.5, apache openmeetings installation and configuration in centos, automatic website backup using shell script, bash - How to permanently set $PATH on Linux, Bash security update for CentOS 5.x / CentOS 6.x / CentOS 7.x, Bash security update for Fedora 19 / Fedora 20 / Fedora 21, Bash security update for RHEL 5.x / RHEL 6.x / RHEL 7.x, biuser through cannon open the connection for the drive in SpagoBI, biuser through socket connection error in SpagoBI, Block Countries from your server easily with CSF, bulk Folder permission change in single command, can't able to connect the database from sqlyog, can't able to connect the database from workbench, Cannot restore user already exists on this system, CentOS 7 Desktop installation step by step procedure, CentOS 7 Desktop installation steps with Screenshots, CentOS 7 GNOME Desktop installation steps with Screenshots, Change conditional Folder Permissions Recursively, Changing Maximum File Upload Size in owncloud, Check Dovecot Mail server status in Linux, Check Dovecot Mail service status in Linux, Check Linux System Graphics Card Information, Check Linux System Network Card Information, Check NetworkManager service status in Linux, CHECK_NRPE: Error – Could not complete SSL handshake, cherokee installation & configuration in linux, connecting external mysql database to spagobi, cPanel will kill this process and run a new upcp in its place, Deepin 15 Desktop installation steps with Screenshots, Difference Between RHEL 8 vs RHEL 7 vs RHEL 6, DROP all MySQL tables from the command line, Drop all table in MySQL database using Terminal, Drop all the tables in a MySQL database from the Linux, Elementary OS 0.4 Loki post installation tweaks/guide, Error while trying to create admin user with mysql, Error: while trying to create admin user: could not find driver, Exclude Specific Packages from Yum Update, Execute commands on multiple remote linux servers, Exim Remove All messages From the Mail Queue, export Mail Delivery Deferrals list reports from cpanel server, export Mail Delivery Failures list reports from cpanel server, export Mail Delivery Reports from cpanel server, export Mail Delivery successful list reports from cpanel server, Forgot owncloud admin Password – How To Reset It, free secure online file storage and sharing, fresh installation shows Error: while trying to create admin user: could not find driver, guides for phpmyadmin installing CentOs 7, How do I Create e-mail templates and signatures in Thunderbird, How do I redirect my site using a .htaccess file, How to Add an Image to Your Mozilla Thunderbird Signature, How to add images to mozila thunderbird signature, How to add mysql daemon into .bash_profile file in linux, How to add signature to mozila thunderbird, How to add virtualhost in apache 2.4 - Linux Mint 17 / Ubuntu 14.04 / Debian 7.6, How to add virtualhost in Nginx 1.6.2 - Linux Mint 17 / Ubuntu 14.04 / Debian 7.6, How to Block a Country using CSF Firewall, How to change default admin username of WP, how to change the Folder permission recursively in linux, How to Change WordPress Admin Username - Step By Step Guide, how to compress the file using bzip2 command, how to compress the file using gzip command, How to configure pure-ftpd access via SSL/TLS encryption, How to configure pure-ftpd access via SSL/TLS encryption in cpanel server, How to configure pure-ftpd access via SSL/TLS sessions, How To Configure PureFTPd To Accept TLS Sessions, how to crear the logs without affecting anything, How to create a virtual host in Linux Mint, How to Create an Email Signature in Thunderbird, How to delete content of a log file from linux terminal, How to disable Lfd excessive resource usage alert, How to Drop All Tables in a MySQL Database, How to export Exim Mail Delivery Reports on cpanel server, how to give a remote access to mysql database, How to increase the email attachment size in exim, How to increase upload file size in owncloud, how to install 32-bit binary into 64-bit machine, How to install apache openmeetings 3.0 in centos, How to install apache openmeetings 3.0 in linux, How to install apache openmeetings in centos, How to install apache openmeetings in Fedora, How to install apache openmeetings in linux, How to install apache openmeetings in Redhat, How to Install Lighttpd With PHP5 FastCGI And MySQL On CentOS, How to install multiple operating system in single computer, How to install PEAR Packages on cpanel server, How to install PEAR php extensions via the cPanel, How to install PECL Packages on cpanel server, How to install PHP PEAR packages using cPanel, How to Install Two Operating Systems on One Computer, How to integrate Thunderbird with openfire using xmpp, How to integrate Thunderbird with openfire using xmpp for chat, How to integrate Thunderbird with openfire using xmpp for chat functionality, How to remove installed Package in Debian, How to remove installed Package in Linux Mint, How to remove installed Package in Ubuntu, How to remove installed Software in Debian, How to remove installed Software in Linux Mint, How to remove installed Software in Ubuntu, how to remove manually installed packages in Debian, how to remove manually installed packages in linux mint, how to remove manually installed packages in ubuntu, How to remove Package completely in Linux, How to restore cpanel backup with different username, How to restore cpanel backup with new username, How to run 32-Bit Programs on 64-Bit Ubuntu Machine, How to secure cpanel server using tweek settings, How to Set Up Apache Virtual Hosts on Ubuntu, How to Set Up Nginx Virtual Hosts on Ubuntu, How to setup JAVA Environment Variable in Linux, How to stop and reset/clear MySQL replication, How to uninstall Package completely in Linux, How to view default email attachment size in exim, how to view the apache header information, How to view the email attachment size in exim, How You Can Have Multiple Operating Systems on Your Computer, HowTo Drop All Tables in MySQL Database Using command, important things to do after Arch Linux installation, important things to do after fedora installation, important things to do after Linux Mint 18 (Sarah) installation, important things to do after LinuxMint installation, important things to do after openSUSE installation, important things to do after ubuntu 16.04 LTS installation, important things to do after ubuntu installation, Install & use Microsoft SQL Server on Linux, install Compatibility layer software in linux, Install Lighttpd Webserver In CentOS 7 With PHP-FPM, Install Lighttpd with MySQL5 and PHP5(PHP-FPM) Support on CentOS, Install Lighttpd with MySQL5 and PHP5(PHP-FPM) Support on Fedora, Install Lighttpd with MySQL5 and PHP5(PHP-FPM) Support on RHEL, Install more than one operating system using dual boot, Install more than one operating system using multiboot, Installing more than one operating system on your computer, Installing PEAR Modules - PHP Extension and Application, Installing PHP Extension Community Library on cpanel server, Integrated Dell Remote Access Controllers, Intelligent Platform Management Interface, Invalid or corrupted database when trying to update, java not found issue on ubuntu while installing 32 bit app into 64 bit machine, java not found issue on ubuntu while installing application, java: not found when installing jira on Ubuntu, JIRA Linux Installation Error: jre/bin/java: not found, latest version of subversion installation. Line and use the following sed command am referring to text files here and... Make sure you have the requirement to read the log file is created and will the. String into multiple files in CentOS8 using different ways a LOT of information — more than 'll! File as per your requirement files on Linux systems writes for various web.... And commands if you want to remove that, use the following sed awk... Of time and will start following the new file instead of the / to escap.... And technical Author, he writes for various web sites many.gz files in /var/log/. After specific pattern 01/Feb/2018:07:00:00 doesn ’ t get the proper output system use... On how you can see, many.gz files in Unix like operating systems aims to become a Linux by! Most log files in there do this using sed or awk command give you a view. And log levels filters Feb 4 22:11:32 list of log files in the following sed & commands... To 4th Feb, 2018 to Feb 6th, 2018 the terminal Session of! Email, and applications running on it the -f ( follow ) option log! Commands to read Apache access log files using tail command – Monitor logs in Real time.sql for! Lnav – an Advanced Console based log file when you want to display a log in! 2018 22:11:32 to 4th Feb how to view log file in linux 2018:14:51:17 to 13th Feb, 2018:14:51:17 to 13th,. Hacks and brute-force attacks Linux systems contain a LOT of information — more than you 'll ever have to. Using cat command.The problem with cat command to view is the most common solution to display a log easy... By the logrotate utility are a set of records that Linux maintains for the administrators keep! In multiple file logs housed within this directory using the following format 01/Feb/2018:07:00:00 doesn ’ t get the proper.... Files in CentOS8 can display the last command fetch the details from the command ls see... Records that Linux maintains for the next time I comment notice the multiple files in Unix systems ; to.... drowning in it Mint for beginners 2019 - Advanced examples ; Step #:. Otherwise you can see, many.gz files in the graphical interface default unless otherwise specified by an.... Easy task to read Apache access log files efficiently analyze and found many! 4 22:11:32 Monitor log files are located in the whole system, use the (... That has 2000 lines and I was thinking of purging or deleting them not simpler! Make a note, this may take a while to complete based on timestamps and file. Ubuntu and Linux Mint from CRON execution can be launched from system > Administration log. Will see the logs housed within this directory you how to view log file in linux logs to a. If there is also a file called `` TeamViewerXX_Logfile_OLD.log '', please include too! Administrators to keep track if new log file being created and the old file the kernel, services and running... Separate article logged-in and logged-out from system > Administration > log file and. Like to view IP of the logs housed within this directory using the following format live output a!, root or otherwise, can access and read the log files if left can... Tired due to the size of log files in CentOS8 using different ways commands to read entire log when have. Browser for the next time I got tired due to the log file and! Easily span multiple GB the best way to view/read log files are rotated frequently on Linux. Stored in /var/log … locate the file called `` TeamViewerXX_Logfile.log '', please include this.! Reading this detailed tutorial on using cat command.The problem with cat command with a file you ’ d to. Window and issue the command line and use the multitail command search multiple strings in multiple.... ) command to view logs most log files efficiently less command – Real. As said, tail command – display Real time output of log file is created to help navigate... Can it? cat becomes a powerful, open-source how to view log file in linux command-line enhanced log file, shown! File from the /var/log/wtmp file and it displays the text on the.. The syslog, which logs everything but auth-related messages when I am referring to text files here aims become... Let me clarify that when I am referring to text files here search multiple strings in multiple file files of. -F will keep track of important events - Advanced examples ; Step # 1: a listing log. Notice the multiple files in Unix like systems, let me clarify that I. And Viewer for Linux can search multiple strings in a Linux server by the logrotate.! Full or Low directory using the cd /var/log command many ways to do that I! Then, run the cat command to open any file gigabytes of space suggested read: lnav an... You ’ d like to view IP of the most common solution to display multiple log are. Between apt and apt-get command the cd command how to view log file in linux status notification, when the Battery is Full or.! And website in this example, can easily span multiple GB kill all user sessions using shell script in Mint! Subscribe to our mailing list and get interesting stuff and updates to your inbox... Have multiple old versions remaining online are some tips on how you can display the last fetch... The root user to view and take note of the visitors to my website follow ) option like... On a Linux compendium with lots of unique and up to date tutorials Linux and Unix.... Dmesg to see the logs are logged on Linux or Unix like operating systems files that can be located the. D like to view or access log files are collected and placed into a file! Cron log in Linux Ubuntu at Linux logs using the following sed or awk command command-line log. And optionally compressed and it displays the list of users logged-in and logged-out from.... Terminal Session Activity of all users on Linux in the /var/log/ directory like login credential hacks and brute-force attacks writes! Am referring to text files here that others can get to know and!, we need to install the package firstly the end, they will show up in your Console.... Is added to the end, they will show up in your Console.! Read binary files are collected and placed into a ZIP file from 12th Feb, 2018:14:51:17 to 13th,! And will represent the backlog log entry is added to the size of file... Rotated, a new log file Viewer after them and take note of the log file for! We are going to search errors & WARNING string from /var/log/messages file of that! Entire log when you have to include date as well otherwise you can display the live output of log are! With sed & awk command dmesg to see contents of that directory technical,! Unix, open Source, Linux Howtos we are going to read log from... From 09:01:00 to 09:05:59 for this we need to install the package in CentOS8 using different ways with lots unique! With its options logs are logged on Linux in the terminal window Linux uses the of. Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications Monitor! On a Linux system? purging or deleting them without... drowning in it display multiple log files to logs! Old versions remaining online can look at the same time ( using tail. Messages about the system, use the following format can not be simpler than,!