Blog
How to read logs in Linux

Command syntax
head option file_name
How to display the first 10 lines of a file with the head command on Linux
head file_name
Show the first N lines of a file in Linux
head -n 6 file_name
The -n option specifies how many rows to display in this case 6 Delete the last N lines of a file on Linux
head -n -5 file_name
Show the first N characters of the file
head -c 10 file_name
Delete the last N characters of the file
head -c -10 file_name
Show filename in header command head
head -n 5 -v file_name
When we are working on several files we will use the command
head -n 5 first_file second_file
Show filename in header command head
head -n 5 -1 first_file second_file
Similar Posts

Basic PowerShell commands
Blog Basic PowerShell commands PowerShell is a cross-platform task automation solution composed of a command-line shell, a scripting language, and a configuration management framework. PowerShell runs on Windows, Linux, and macOS. Get-Help The Get-Help cmdlet serves as documentation, in other words, it displays help for commands Get-Help command Get-Help Get-Process Get-Help parameters parameter -Examples, displays…

How to read logs in Linux
Blog How to read logs in Linux Linux stores its log files in the /var/log directory in text format. tail command The tail command is the most common solution for viewing a real-time log file. However, the command to view the file has two versions, as shown in the following examples. The tail command needs…

How to install Cockpit on CentOS Linux
Blog How to install Cockpit on CentOS Linux Cockpit (RHEL web console) or how to manage the server through the GNU/Linux browser. What is Cockpit Cockpit is a free open source server management project by Redhat. The main goal of the project is to offer Linux administrators the ability to quickly and efficiently manage their…