Index: uspace/app/bdsh/cmds/modules/head/entry.h
===================================================================
--- uspace/app/bdsh/cmds/modules/head/entry.h	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
+++ uspace/app/bdsh/cmds/modules/head/entry.h	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
@@ -0,0 +1,9 @@
+#ifndef HEAD_ENTRY_H
+#define HEAD_ENTRY_H
+
+/* Entry points for the head command */
+extern int cmd_head(char **);
+extern void help_cmd_head(unsigned int);
+
+#endif /* HEAD_ENTRY_H */
+
Index: uspace/app/bdsh/cmds/modules/head/head.c
===================================================================
--- uspace/app/bdsh/cmds/modules/head/head.c	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
+++ uspace/app/bdsh/cmds/modules/head/head.c	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
@@ -0,0 +1,110 @@
+/* Automatically generated by mknewcmd on Thursday 03 December 2020 11:32:57 AM
+ * IST This is machine generated output. The author of mknewcmd claims no
+ * copyright over the contents of this file. Where legally permitted, the
+ * contents herein are donated to the public domain.
+ *
+ * You should apply any license and copyright that you wish to this file,
+ * replacing this header in its entirety. */
+
+#include "head.h"
+#include <stdlib.h>
+#include "cmds.h"
+#include "config.h"
+#include "entry.h"
+#include "errors.h"
+#include "stdio.h"
+#include "string.h"
+#include "util.h"
+
+static const char *cmdname = "head";
+
+/* Dispays help for head in various levels */
+void help_cmd_head(unsigned int level)
+{
+	printf("This is the %s help for '%s'.\n", level ? EXT_HELP : SHORT_HELP,
+	    cmdname);
+	return;
+}
+
+static int getline(char **lineptr, size_t *n, FILE *stream)
+{
+	static char line[256];
+	char *ptr;
+	unsigned int len;
+
+	if (lineptr == NULL || n == NULL) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if (ferror(stream))
+		return -1;
+
+	if (feof(stream))
+		return -1;
+
+	fgets(line, 256, stream);
+
+	ptr = strchr(line, '\n');
+	if (ptr)
+		*ptr = '\0';
+
+	len = strlen(line);
+
+	if ((len + 1) < 256) {
+		ptr = realloc(*lineptr, 256);
+		if (ptr == NULL)
+			return (-1);
+		*lineptr = ptr;
+		*n = 256;
+	}
+
+	strcpy(*lineptr, line);
+	return (len);
+}
+
+/* Main entry point for head, accepts an array of arguments */
+int cmd_head(char **argv)
+{
+	unsigned int argc;
+
+	/* Count the arguments */
+	for (argc = 0; argv[argc] != NULL; argc++)
+		;
+
+	FILE *fp;  // file pointer
+	char *line = NULL;
+	size_t len = 0;
+
+	int cnt = 0;
+
+	if (argc < 3) {
+		printf("Insufficient Arguments!!!\n");
+		printf("Please use \"program-name file-name N\" format.\n");
+		return -1;
+	}
+
+	// open file
+	fp = fopen(argv[1], "r");
+
+	// checking for file is exist or not
+	if (fp == NULL) {
+		printf("\n%s file can not be opened !!!\n", argv[1]);
+		return 1;
+	}
+
+	// read lines from file one by one
+	while (getline(&line, &len, fp) != -1) {
+		cnt++;
+		if (cnt > atoi(argv[2]))
+			break;
+
+		printf("%s\n", line);
+		fflush(stdout);
+	}
+
+	// close file
+	fclose(fp);
+
+	return CMD_SUCCESS;
+}
Index: uspace/app/bdsh/cmds/modules/head/head.h
===================================================================
--- uspace/app/bdsh/cmds/modules/head/head.h	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
+++ uspace/app/bdsh/cmds/modules/head/head.h	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
@@ -0,0 +1,8 @@
+#ifndef HEAD_H
+#define HEAD_H
+
+/* Prototypes for the head command, excluding entry points */
+
+
+#endif /* HEAD_H */
+
Index: uspace/app/bdsh/cmds/modules/head/head_def.inc
===================================================================
--- uspace/app/bdsh/cmds/modules/head/head_def.inc	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
+++ uspace/app/bdsh/cmds/modules/head/head_def.inc	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
@@ -0,0 +1,7 @@
+{
+	"head",
+	"Read first n lines of a file",
+	&cmd_head,
+	&help_cmd_head,
+},
+
Index: uspace/app/bdsh/cmds/modules/modules.c
===================================================================
--- uspace/app/bdsh/cmds/modules/modules.c	(revision 738d5a49677ed59042bcc631803ee36546c74ed8)
+++ uspace/app/bdsh/cmds/modules/modules.c	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
@@ -67,4 +67,5 @@
 #include "basename/entry.h"
 #include "grep/entry.h"
+#include "head/entry.h"
 
 /*
@@ -96,4 +97,5 @@
 #include "basename/basename_def.inc"
 #include "grep/grep_def.inc"
+#include "head/head_def.inc"
 
 	{ NULL, NULL, NULL, NULL }
Index: uspace/app/bdsh/meson.build
===================================================================
--- uspace/app/bdsh/meson.build	(revision 738d5a49677ed59042bcc631803ee36546c74ed8)
+++ uspace/app/bdsh/meson.build	(revision 83d665a6c564fb1cf94a2bcfdbf48c7cc690b8a7)
@@ -61,4 +61,5 @@
 	'cmds/modules/basename/basename.c',
 	'cmds/modules/grep/grep.c',
+	'cmds/modules/head/head.c',
 	'compl.c',
 	'errors.c',
