您的位置:首页 > 运维架构 > Linux

Linux文件管理-文件处理

2014-09-16 08:46 316 查看

文件处理命令:touch



[root@localhost test2]# touch avnvyou.list
[root@localhost test2]# ls -l
总用量 0
-rw-r--r--. 1 root root 0 9月 16 08:22 avnvyou.list
[root@localhost test2]# pwd
/tmp/test2
[root@localhost test2]# touch /tmp/test2/avnvyou2.list
[root@localhost test2]# ls -l
总用量 0
-rw-r--r--. 1 root root 0 9月 16 08:23 avnvyou2.list
-rw-r--r--. 1 root root 0 9月 16 08:22 avnvyou.list
[root@localhost test2]# #不建议文件名中使用空格
[root@localhost test2]# touch "progarm files"
[root@localhost test2]# ls -l
总用量 0
-rw-r--r--. 1 root root 0 9月 16 08:23 avnvyou2.list
-rw-r--r--. 1 root root 0 9月 16 08:22 avnvyou.list
-rw-r--r--. 1 root root 0 9月 16 08:25 progarm files
[root@localhost test2]#

文件处理命令:cat



文件处理命令:tac



[root@localhost test2]# cat /etc/issue
[root@localhost test2]# cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m

[root@localhost test2]# cat -n /etc/issue
1 CentOS release 6.4 (Final)
2 Kernel \r on an \m
3
[root@localhost test2]# tac /etc/issue

Kernel \r on an \m
CentOS release 6.4 (Final)


文件处理命令:more



文件处理命令:less



在 less时 可以输入/   输入内容 做搜索      按 n选择下一个搜索到的内容

文件处理命令:head



[root@localhost test2]# head -10 /etc/services
# /etc/services:
# $Id: services,v 1.48 2009/11/11 14:32:31 ovasik Exp $
#
# Network services, Internet style
# IANA services version: last updated 2009-11-10
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
# Updated from RFC 1700, ``Assigned Numbers'' (October 1994). Not all ports


文件处理命令:tail



[root@localhost test2]# tail -10 /etc/services
nimgtw 48003/udp # Nimbus Gateway
3gpp-cbsp 48049/tcp # 3GPP Cell Broadcast Service Protocol
isnetserv 48128/tcp # Image Systems Network Services
isnetserv 48128/udp # Image Systems Network Services
blp5 48129/tcp # Bloomberg locator
blp5 48129/udp # Bloomberg locator
com-bardac-dw 48556/tcp # com-bardac-dw
com-bardac-dw 48556/udp # com-bardac-dw
iqobject 48619/tcp # iqobject
iqobject 48619/udp # iqobject
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: