Want this question answered?
Be notified when an answer is posted
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.
'grep' searches a file for lines which match a given regular expression.
To search a file for lines which match a given regular expression.
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.
Use the following:awk 'END { print NR }'Awk will count the lines and print it out.
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.
You don't need a shell script to do this - just use the 'tail' command.
more command
Assuming that the file you are looking at is a columnar file you can use the 'cut' command, as in 'cut -c1-2 filename'
SSH.
The "sort" command.
Use the 'grep' family of commands to search for string pattern matches in multiple files.