码迷,mamicode.com
首页 > 其他好文 > 详细

head和tail命令

时间:2017-02-16 14:38:50      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:local   keycloak   5.6   one   key   UI   没有   images   author   

vim Dockerfile

############################################################
#dckerfile to build mysql for mir container images
# Based on Ubuntu
# ############################################################
FROM 172.16.101.192/common/mysql:5.6
# File Author / Maintainer
MAINTAINER huzhengbo
#ADD mir_scalr.sql to container docker-entrypoint-initdb.d
ADD analytics.sql /docker-entrypoint-initdb.d
ADD scalr.sql /docker-entrypoint-initdb.d
ADD keycloak.sql /docker-entrypoint-initdb.d
ADD mirmon.sql /docker-entrypoint-initdb.d
ADD mir_scalr.sql /docker-entrypoint-initdb.d
ADD mir_pack.sql /docker-entrypoint-initdb.d
ADD oneaa.sql /docker-entrypoint-initdb.d
ADD one_log.sql /docker-entrypoint-initdb.d
#the mysql port
EXPOSE 3306

head得到头部6行

head -n +6 Dockerfile或head -n 6 Dockerfile

[root@localhost mysqlDockerfile]# head -n +6 Dockerfile 
############################################################
#dckerfile to build mysql for mir container images
# Based on Ubuntu
# ############################################################
FROM 172.16.101.192/common/mysql:5.6
# File Author / Maintainer

删掉尾部2行(并没有从文件删除掉)

head -n -6 Dockerfile

############################################################
#dckerfile to build mysql for mir container images
# Based on Ubuntu
# ############################################################
FROM 172.16.101.192/common/mysql:5.6
# File Author / Maintainer
MAINTAINER huzhengbo
#ADD mir_scalr.sql to container docker-entrypoint-initdb.d
ADD analytics.sql /docker-entrypoint-initdb.d
ADD scalr.sql /docker-entrypoint-initdb.d
ADD keycloak.sql /docker-entrypoint-initdb.d
ADD mirmon.sql /docker-entrypoint-initdb.d

删除掉头部6行

tail -n +5 Dockerfile或tail -n 5 Dockerfile

FROM 172.16.101.192/common/mysql:5.6
# File Author / Maintainer
MAINTAINER huzhengbo
#ADD mir_scalr.sql to container docker-entrypoint-initdb.d
ADD analytics.sql /docker-entrypoint-initdb.d
ADD scalr.sql /docker-entrypoint-initdb.d
ADD keycloak.sql /docker-entrypoint-initdb.d
ADD mirmon.sql /docker-entrypoint-initdb.d
ADD mir_scalr.sql /docker-entrypoint-initdb.d
ADD mir_pack.sql /docker-entrypoint-initdb.d
ADD oneaa.sql /docker-entrypoint-initdb.d
ADD one_log.sql /docker-entrypoint-initdb.d
#the mysql port
EXPOSE 3306

得到尾部5行

tail -n -5 Dockerfile

ADD mir_pack.sql /docker-entrypoint-initdb.d
ADD oneaa.sql /docker-entrypoint-initdb.d
ADD one_log.sql /docker-entrypoint-initdb.d
#the mysql port
EXPOSE 3306

 

head和tail命令

标签:local   keycloak   5.6   one   key   UI   没有   images   author   

原文地址:http://www.cnblogs.com/boshen-hzb/p/6405158.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!