Linux文件管理-文件处理

文件处理命令: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




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值