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

Chmod command in Linux with examples
Blog Chmod command in Linux with examples Linux chmod command is used to change the access permissions of files and directories. Chmod Command Changes the access permissions of a file or directory. On Unix systems, permissions apply to: read (r) write (w) execute (x) chmod syntax chmod [options] [permissions] [file name] chmod…

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…

How to Enable Blocked USB Ports
Blog Useful tools for DNS troubleshooting We can most often meet with the blockade of USB ports in schools or workplaces and this is due to security reasons. Media connected to the USB port facilitate work, but also pose a serious threat to the data stored on the disk and the systems. It is very…

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…

Useful tools for DNS troubleshooting
Blog Useful tools for DNS troubleshooting Domain Name System – a hierarchical distributed network name system that responds to domain name queries. Thanks to DNS, the domain name is translated into the corresponding IP address. How the DNS server works The user enters the website address in the browser. Browser sends a query to the…