- Linux 管理員教程
- 主頁
- CentOS 概述
- 基本 CentOS Linux 命令
- 檔案/資料夾管理
- 使用者管理
- 配額管理
- 用 systemctl 啟停 Systemd 服務
- 用 systemctl 進行資源管理
- 用 cgroups 進行資源管理
- 程序管理
- 防火牆設定
- 在 CentOS Linux 中配置 PHP
- 在 CentOS Linux 中設定 Python
- 在 CentOS Linux 中配置 Ruby
- 在 CentOS Linux 中設定 Perl
- 安裝和配置 Open LDAP
- 建立 SSL 證書
- 在 CentOS 7 中安裝 Apache Web 伺服器
- 在 CentOS 7 中設定 MySQL
- 設定 Postfix MTA 和 IMAP/POP3
- 安裝匿名 FTP
- 遠端管理
- 在 CentOS 中監控流量
- 日誌管理
- 備份與恢復
- 系統更新
- Shell 指令碼
- 軟體包管理
- 卷管理
- 有用的 Linux 管理員資源
- Linux 管理員——快速指南
- Linux 管理員——有用資源
- Linux 管理員——討論
Linux 管理員——head 命令
對於檔案操作所執行部分而言,head 與 tail 基本相反。預設情況下,head 會讀取檔案的前 10 行。
head 提供了與 tail 相似的選項 −
| 開關 | 操作 |
|---|---|
| -c | 輸出上次用千位元組表示的內容 |
| -n | 從 eof 輸出 n 行 |
| -q | 只有檔案內容而沒有標題 |
注意 − 由於檔案是從底部追加的,所以 Head 不提供 -f 選項。
**head** 在讀取配置檔案的說明時非常有用。在編寫此類檔案時,有效利用前 10 行是一個不錯的主意。
[root@centosLocal centos]# head /etc/sudoers ## Sudoers allows particular users to run various commands as ## the root user, without needing the root password. ## ## Examples are provided at the bottom of the file for collections ## of related commands, which can then be delegated out to particular ## users or groups. ## ## This file must be edited with the 'visudo' command. ## Host Aliases [root@centosLocal centos]#
basic_centos_linux_commands.htm
廣告