answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What command returns the first few lines of a given file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is head command in UNIX?

The 'head' command will list out certain number of lines in a file from the beginning. The standard is to list the first 25 lines, but you can change that: head -100 myfile will list out the first 100 lines of myfile.


What is grep command?

'grep' searches a file for lines which match a given regular expression.


What is the function of grep command?

To search a file for lines which match a given regular expression.


What is difference between code and command?

A code is a set of words or lines made to do most of the task a command is a set of instruction given with authority.


By using awk programming how to count number of lines in a given file without wc command?

Use the following:awk 'END { print NR }'Awk will count the lines and print it out.


You are using vi to edit a file and have just entered 12 new lines You need to replicate the same 12 lines right after you enter them what command-mode command can you type to replicate the lines?

After you enter the 12 lines, go back to command mode, go to the first of the 12 lines and yank the 12 lines into a buffer.Go to the end of file (or wherever you want them placed) and use the 'put' operation to insert them. I do this all the time; very common operation.


How do you write a shell script which counts the last 10 lines present in a given file?

You don't need a shell script to do this - just use the 'tail' command.


Which command allows you to view your file 24 lines at a time?

more command


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'


Which command provides secure command lines access to a romate Linux machine?

SSH.


What command is used to sort the lines of data in a file alphabetical order?

The "sort" command.


In unix command to search files for lines that match a particular string pattern given?

Use the 'grep' family of commands to search for string pattern matches in multiple files.