answersLogoWhite

0


Best Answer

At the prompt, type:

head filename

For example, if you have a file named file.txt, type:

head file.txt

To fetch a specific number of records from a file, e.g. 15, type:

head -15 file.txt

To see more options of 'head' command run 'man head'.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the command to fetch first 10 records in a file in unix?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you make a new command in Unix?

first, make a file. in the file you type in the command's name. an example would be the command date. name the file what you want to call that command. when you use the command, type in cat filename and the computer will do the command.


What Linux command is used for displaying all the records with space or special characters between fields in the file?

cat


What is the unix command to display the first two characters of all the lines from a file?

Assuming that the file you are looking at is a columnar file you can use the 'cut' command, as in 'cut -c1-2 filename'


Is save command used for save a file first time?

yes


What command do you use to save a file?

The Save command, which can also be activated by the Ctrl - S keyboard shortcut. If it is the first time it is being saved, then you can use Save As. This will happen automatically as when it is first saved you need to specify a name, location and the file type for the file.


When are records transferred from the general alphabetic file to the numbered file?

When are records transferred from the general alphabetic file to the numbered file?


Why file command is used in unix?

The 'file' command in Unix attempts to guess what type of file you are looking at by reading the first several sections of the file and comparing it to a list of known contents for files. It is a useful command if you just want to know what type of file something is without having to examine it yourself. The command is not perfect because it does not detect all types of files but it does a reasonable job of guessing. It is used because in Unix there are no file extension types to tell us what kind of file a given file might be; you have to look inside the file to tell how it might be used.


What is a file command used to create or start a new file?

The 'touch' command creates a new empty file in Unix.


What does the command prompt DEL do?

the DEL command deletes a specified file when typed in the form below: del file for more information about the command, type : del /? in command prompt


How do you make a command on Ubuntu 9.04?

Anything can be made into a command on a Linux system. The steps are easy. First, using any text editor (vim, emacs, etc.) create a text file. Put anything you want to do in this file. Save the file. Make sure the file you just created has read and execute permissions (chmod). That's it! Now you have a command that you can execute in Linux.


What is the command to execute it sfc?

that is the command for system file checker.


What does DOS mean when it tells you bad command or file name?

The DOS message "bad command or file name" means that the command you entered was not recognized as an internal command or as an external command in the working directory or path.