Linux Commands for Beginners--Head and Tail Command
来源:互联网 发布:无法获取摄像头数据 编辑:程序博客网 时间:2024/05/17 22:27
In this part, I go over both the head and tail commands.
1.COMMAND:
head
DESCRIPTION:
Print the first 10 lines of FILE to standard output.
SYNOPSIS:
head [OPTION]... [FILE]...
OPTION:
-n, --lines
print the first n lines instead of the first 10;
2.COMMAND:
tail
DESCRIPTION:
Print the last 10 lines of FILE to standard output.
SYNOPSIS:
tail [OPTION]... [FILE]...
OPTION:
-n, --lines output the last K lines, instead of the last 10;
Examples:
root@piniheaven:~/tutorial# ls
poem.txt
root@piniheaven:~/tutorial# head poem.txt # Print the first 10 lines of poem.txt to standard output.
nt you to know
one thing.
You know how this is:
if I look
at the crystal moon, at the red branch
of the slow autumn at my window,
if I touch
near the fire
the impalpable ash
root@piniheaven:~/tutorial# head -4 poem.txt # Print the first 4 lines of poem.txt to standard output.
nt you to know
one thing.
You know how this is:
root@piniheaven:~/tutorial# tail poem.txt # Print the last 10 lines of poem.txt to standard output.
you feel that you are destined for me
with implacable sweetness,
if each day a flower
climbs up to your lips to seek me,
ah my love, ah my own,
in me all that fire is repeated,
in me nothing is extinguished or forgotten,
my love feeds on your love, beloved,
and as long as you live it will be in your arms
without leaving mine
root@piniheaven:~/tutorial# tail -3 poem.txt # Print the last 3 lines of poem.txt to standard output.
my love feeds on your love, beloved,
and as long as you live it will be in your arms
without leaving mine
1.COMMAND:
head
DESCRIPTION:
Print the first 10 lines of FILE to standard output.
SYNOPSIS:
head [OPTION]... [FILE]...
OPTION:
-n, --lines
print the first n lines instead of the first 10;
2.COMMAND:
tail
DESCRIPTION:
Print the last 10 lines of FILE to standard output.
SYNOPSIS:
tail [OPTION]... [FILE]...
OPTION:
-n, --lines output the last K lines, instead of the last 10;
Examples:
root@piniheaven:~/tutorial# ls
poem.txt
root@piniheaven:~/tutorial# head poem.txt # Print the first 10 lines of poem.txt to standard output.
nt you to know
one thing.
You know how this is:
if I look
at the crystal moon, at the red branch
of the slow autumn at my window,
if I touch
near the fire
the impalpable ash
root@piniheaven:~/tutorial# head -4 poem.txt # Print the first 4 lines of poem.txt to standard output.
nt you to know
one thing.
You know how this is:
root@piniheaven:~/tutorial# tail poem.txt # Print the last 10 lines of poem.txt to standard output.
you feel that you are destined for me
with implacable sweetness,
if each day a flower
climbs up to your lips to seek me,
ah my love, ah my own,
in me all that fire is repeated,
in me nothing is extinguished or forgotten,
my love feeds on your love, beloved,
and as long as you live it will be in your arms
without leaving mine
root@piniheaven:~/tutorial# tail -3 poem.txt # Print the last 3 lines of poem.txt to standard output.
my love feeds on your love, beloved,
and as long as you live it will be in your arms
without leaving mine
- Linux Commands for Beginners--Head and Tail Command
- Linux Commands for Beginners--The top Command
- Linux Commands for Beginners--The Watch Command
- Linux Commands for Beginners--which and whatis commands
- Linux Commands for Beginners--Changing Ownership --chown command
- Linux Commands for Beginners-- Changing Permissions --chmod command
- Linux Commands for Beginners-- Regular Expressions--the grep command
- Linux Commands for Beginners-- Echo And Creating Variables
- Linux Commands For Beginners: SUDO
- Linux Commands for Beginners--The .bashrc File
- Linux Commands for Beginners--Finding Files
- Linux Commands for Beginners--Create Your Own Commands Via alias
- Linux Commands for Beginners--Viewing Resources--du,df,free commands
- Linux Commands for Beginners--Arithmetic in Bash--expr,let commands
- Linux Commands for Beginners---SSH for Remote Administration
- Linux Commands for Beginners-- FTP for Remote Administration
- Linux Commands for Beginners--Creating Your First Scripting
- useful links for Unix and Linux beginners
- How Many Trees?
- java工具类总结
- SQL Server2008附加数据库
- ios:播放在线的网络视频
- 大数相减
- Linux Commands for Beginners--Head and Tail Command
- Throwing cards away II
- 西部数据移动硬盘检测与分区
- oracle 10g 创建JOB
- 配置环境变量
- 【U盘修复工具的使用教程】
- 【※主题下载の命零电脑桌面主题※】
- Sort a K sorted array
- Android 解屏幕锁与点亮屏幕