@gaston
To output the first line from every file in Linux, you can use the head
command in combination with a file globbing pattern. Here's the command:
1
|
head -n 1 * |
Explanation:
When you run this command, it will display the first line of every file in the current directory.
@gaston
Alternatively, you can use a combination of the find command and head command to achieve the same result:
find . -type f -exec head -n 1 {} ;
Explanation:
This command will find all files in the current directory and print the first line of each file.