Download ArticleDownload Article

To check error logs for a Linux server in PuTTY, you'll need to know the name and location of the log file (usually /var/logs). Use the "cd" command to enter the directory, then use the "tail" or "more" command to see what's in the log. This How.com.vn will teach you how to check error logs in PuTTY.

Quick Steps

  1. Log in to a server with PuTTY.
  2. Use the cd command (e.g., cd /var/logs) to enter the directory containing the error log.
  3. Type "tail -n 10 <log name>" to view the last 10 lines of the log.
  4. Alternatively, type "more <log name>" to open the entire log file.
  1. How.com.vn English: Step 1 Open PuTTY.
    Double-click the PuTTY icon on your Desktop to open it or search your Start menu.
  2. How.com.vn English: Step 2 Connect to your server.
    Enter your hostname (or IP address), port number, and password to connect to your server with PuTTY.
    Advertisement
  3. How.com.vn English: Step 3 Navigate the PuTTY window to your logs.
    In most instances, you can use "cd ~/logs" or "/var/www/vhosts/example.com/statistics/logs/".
  4. How.com.vn English: Step 4 Enter the command to see your error logs.
    The command varies between servers and operating systems, but the default is similar to: "tail -n 10 error.log".
    • If you get an error message or don't receive an answer, your error logs might be in a different location. Check with your server's information to find the file path your logs are stored.
    • Some commands will require root access and should start with "sudo" to work.
  5. Advertisement


Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Thanks for submitting a tip for review!

Common Questions

How do I view logs in Linux?

The most common location for logs is /var/logs. Type cd /var/logs to enter the directory, then type ls -a to see which logs are in the directory. To view a log, type more <log file name>, then use the spacebar to page through each screen.

How do I check files in PuTTY?

To see which files are in a directory, type ls -a. Or, use ls -al to see all files and subdirectories, as well as their permissions. To view the contents of a text file, type cat <filename>, or use more <filename> to browse the file screen by screen.

How do I search logs in Linux terminal?

Use the "grep" command to search for text in any file, including log files. For example, grep -l "error" *.* will search for the word "error" in all files within the current directory. You can also use cat <logfilename> to find text within a specific log file.

About This Article

How.com.vn English: Darlene Antonelli, MA
Written by:
How.com.vn Technology Writer
This article was co-authored by How.com.vn staff writer, Darlene Antonelli, MA. Darlene Antonelli is a Technology Writer and Editor for How.com.vn. Darlene has experience teaching college courses, writing technology-related articles, and working hands-on in the technology field. She earned an MA in Writing from Rowan University in 2012 and wrote her thesis on online communities and the personalities curated in such communities. This article has been viewed 49,662 times.
How helpful is this?
Co-authors: 4
Updated: May 7, 2024
Views: 49,662
Categories: Servers
Article SummaryX

1. Open PuTTY.
2. Connect to your server.
3. Navigate the PuTTY window to your logs.
4. Enter the command to see your error logs.

Did this summary help you?

Thanks to all authors for creating a page that has been read 49,662 times.

Is this article up to date?

⚠️ Disclaimer:

Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

Notices:
  • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
  • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
  • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
  • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

Advertisement