×

Use of Head Command in Linux - With different examples ?

This article covers how to use head command with all required options. 

By using the tail command with a head command, you can also display the last lines of a file on the terminal.

The head command, as the name implies, print the top N number of data of the given input. 

By default, it prints the first 10 lines of the specified files. 

If more than one file name is provided then data from each file is preceded by its file name. 


Head command Syntax:

head [OPTION]... [FILE]...


Wall Command in Linux with Examples - Learn Now

This article covers how Wall command works in Linux. Wall is a handy utility that helps a multi-user system admin to quickly notify other users to save their work before a system shutdown or reboots. 

Here, you will see some examples of how to use the wall command to communicate with logged-in users.

There are times when multiple users are logged in to a server computer, and you - the system/network admin - need to, say, restart the server to perform some maintenance task. 

Of course, the correct way is to inform all those who are logged in about the maintenance activity.

In Linux, there is a built in command line utility for this purpose called Wall.


What is wall command in Linux ?

As already mentioned, the wall command is used to send a message to all logged in users. 

It's syntax is:

$ wall [-n] [-t TIMEOUT] [file]


How to use wall command?

Basic usage is very straight forward - just execute the 'wall' command and write the message you want to transmit on the standard input. 

Once done, use the Ctrl+D key combination to signal the command that you're done writing the message: 

$ wall


How to remove header from broadcasted message?

In case you want to remove the header that appears with the broadcasted messages, you can do that using the -n command line option:

$ wall -n