Selectively view the file method Head tail sed View file part content

zhaozj2021-02-11  211

Selective way to view files

Skill administrator (2000-12-22 22:39) 〖Back〗 〖Forward〗

If you just want to watch the top 5 lines of the file, you can use the head command, such as: head -5 / etc / passwd If you want to view the file 10 line, you can use the tail command, such as: tail -10 / etc / passwd you Do you know how to view the middle of the file? You can use the sed command such as: Sed -n '5, 10p' / etc / passwd, you can only view the fifth line of the file to 10th lines.

转载请注明原文地址:https://www.9cbs.com/read-3566.html

New Post(0)