Artificial Intelligence
Please fill the required field.

How do you display the last 10 lines of a file in Linux?


To display the last 10 lines of a file in Linux, you can use the `tail` command. The basic syntax is: ```bash tail filename ``` This command will output the last 10 lines of the specified file by default. If you want to specify a file, just replace `filename` with the actual name of your file. For example, to display the last 10 lines of a file called `example.txt`, you would use: ```bash tail example.txt ``` If you want to display a different number of lines, you can use the `-n` option followed by the number of lines you want to see. For example, to display the last 20 lines, you would use: ```bash tail -n 20 filename ``` Alternatively, if you only want to output the last few lines (like 10), you can simply type: ```bash tail -n 10 filename ``` These commands should work in most Linux distributions and terminals.