A lot of what an administrator or programmer does is hunt through text files. These may be log files from a web server, error files from an application, or simply a large ASCII document such as a script.
You may have guessed what this command does - it shows you the top 10 lines of a text file.
head sudo.txt
SUDO(8) System Manager's Manual SUDO(8)
NAME
sudo, sudoedit - execute a command as another user
SYNOPSIS
sudo -h | -K | -k | -V
sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
10 is the default number of lines, but you can adjust that:
head -n25 sudo.txt
SUDO(8) System Manager's Manual SUDO(8)
NAME
sudo, sudoedit - execute a command as another user
SYNOPSIS
sudo -h | -K | -k | -V
sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
sudo [-AbEHnPS] [-C num] [-g group] [-h host] [-p prompt] [-u user]
[VAR=value] [-i | -s] [command]
sudoedit [-AknS] [-C num] [-g group] [-h host] [-p prompt] [-u user]
file ...
DESCRIPTION
sudo allows a permitted user to execute a command as the superuser or
another user, as specified by the security policy. The invoking user's
real (not effective) user ID is used to determine the user name with
which to query the security policy.
sudo supports a plugin architecture for security policies and
input/output logging. Third parties can develop and distribute their own
You can also specify how many characters you want to see:
head -c53 sudo.txt SUDO(8) System Manager's Manual
Don't forget you can also use this as part of a pipeline.
Maybe a bit more useful, at least when looking at log files.
tail sudo.txt
DISCLAIMER
sudo is provided AS IS and any express or implied warranties, including,
but not limited to, the implied warranties of merchantability and fitness
for a particular purpose are disclaimed. See the LICENSE file
distributed with sudo or https://www.sudo.ws/license.html for complete
details.
Sudo 1.8.17p1 January 19, 2016 SUDO(8)
This command has a few more options available besides the number of lines to view:
tail -n +624 sudo.txt Sudo 1.8.17p1 January 19, 2016 SUDO(8)
I can't stress how useful these commands are when used in a pipeline.
cat | less | more