answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the unix command to display the first two characters of all the lines from a file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write the UNIX command to display the number of characters lines and words in the files myfile1txt myfile2txt and myfile3txt?

Use the 'wc' command: wc myfile[123].txt


Which command will display the last lines of the text file called file1in Linux?

Tail command is used to display the last lines of the file.Syntax:tail -n 3 file1-n 3 = no. of linesfile1 = filename


What command do you use to display text on two lines within a cell?

Merge and Center


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 option would allow the head command to display the last 5 lines in a file in Linux?

The 'head' command can only deal with the start of the file, not the end. If you want X number of lines at the end of the file then use the 'tail' command. tail -5 filename will list the last 5 lines of the contents of filename.


List and execute UNIX command to display the number of words in the last 10 lines of any file?

tail -10 anyfile | wc


What is the order that you press the little lines on nabooti island?

At the first challenge in the tomb, the display shows (-|--). Press the first, third, and fourth lines once, and the lines will line up (----)


In unix what does the wc command output?

wc is used to count the characters/words/lines in a file or files. You might use it to see how productive you've been (did you finish that 5000 word essay you were supposed to write) or to see how productive some one else has been... The options control characters/words/lines: with no options it gives all three: $ wc notes 56 219 1607 notes There are 56 lines, 219 words, 1607 characters. $ wc -l notes 56 notes I just wanted to know how many lines.


How many lines in an Excel sheet?

Are you talking about No. of rows in a Excel sheet? If Yes then you can see it yourself by following command: Ctrl+Down Arrow - display total no. of rows. Ctrl+Forward Arrow - display total no. of columns.


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.


What is interlaced display?

Interlaced display is a type of cathode ray tube. The lines are in an alternating pattern that focuses on interwoven and rasterized lines.


List and execute UNIX command to display the sizes of the six largest files in the current directory listed in ascending order of their size?

There are several ways to do this (typical Unix ...). you could execute the following command: du | sort -n | tail -6 The 'du' command lists disk usage by listing a file name and size per line, then use the sort command to list numerically, and the last 6 will be the 6 largest.