Afficher/masquer le menu
Liens Ecyseo
  • Tags cloud
  • Daily
  • Pictures wall
  • ► Play Videos
  • Search
  • Display options
    • Links per page :
    • 20 links
    • 50 links
    • 100 links
  • RSS Feed
  • Login

J'ai besoin d'intimité. Non pas parce que mes actions sont douteuses, mais parce que votre jugement et vos intentions le sont.

5061 links 

page 1 / 1

Liste des liens

Linux: How to view log files on the shell?
Tue 28 Mar 2017 02:05:25 AM CEST - permalink -

Many Linux servers are administered on the commandline e.g. with an SSH connection. In the following article, I will explain several shell commands that make it easy to view logfiles.

The most important command is tail. Tail can be used to read the last lines from a file. Examples:

Get the last 100 lines from the Debian mail log file:

tail -n 100 /var/log/mail.log

To get all newly added lines from a log file in realtime on the shell, use the command:

tail -f /var/log/mail.log

to quit tail and go back to the command line press the keys [ctrl] + [c]

If you want to get the last 1000 lines from a log file and they do not fit into your shell window, you can use the command "more" to be able to view them line by line.

tail -n 1000 /var/log/mail.log | more

press [space] to go to the next line or [ctrl] + [c] to quit.

If you want to search for a specific term in a large file, the command "grep" comes in handy. Example: We search for the email address "tom@anydomain.tld" in the mail log file:

grep "tom@anydomain.tld" /var/log/mail.log

If you want to view the whole content of a file on the shell, use the command "cat". Example:

cat /proc/cpuinfo

will show you detailed info about the CPU of your computer.

console Linux logs
- - https://www.faqforge.com/linux/distributions/debian/linux-how-to-view-log-files-on-the-shell/
Thu 01 Jan 1970 01:00:00 AM CET - permalink -
page 1 / 1


Tags


  • shaarli
  • wikipedia

Tags cloud

Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation
Affiches "loi aviva" créées par Geoffrey Dorne le 13 Mai, 2020