跳到主要内容

Reading files

English

Reading a file

  • cat prints a file's contents straight to the screen:
cat poem.txt
  • It is named after "concatenate" — it can also join several files together.

head -2 shows the first two lines of poem.txt, tail -2 the last two, and wc -l counts 6 lines

登录或创建账户

IGCSE, A-Level & AP