Linux echo print命令,linux常用命令-echo/printf/file

echo:显示文本

NAME

echo - display a line of text

SYNOPSIS

echo [SHORT-OPTION]... [STRING]...

echo LONG-OPTION

-n

[root@localhost doc]# echo -n

[root@localhost doc]# echo

[root@localhost doc]#

[root@localhost doc]# echo -n "this year is 2017,\n the day is Feb 11"

this year is 2017,\n the day is Feb 11[root@localhost doc]#

-e:文本开启转义符

[root@localhost doc]# echo "this year is 2017,\n the day is Feb 11"

this year is 2017,\n the day is Feb 11

[root@localhost doc]# echo -e "this year is 2017,\n the day is Feb 11"

this year is 2017,

the day is Feb 11

文本颜色[字体;前景色;背景色],[1m

-e \033 [1mhello\033[0m

ctrl

[root@localhost ~]# echo -e "\033[33mhello\033[0m,world"

hello,world

[root@localhost ~]#

[root@localhost ~]# echo -e "\033[33;41mhello\033[0m,world"

hello,world

[root@localhost ~]#

[root@localhost ~]# echo -e "\033[1;33mhello\033[0m,world"

hello,world

[root@localhost ~]#

printf:格式化并显示文本

PRINTF(1)                        User Commands                       PRINTF(1)

NAME

printf - format and print data

SYNOPSIS

printf FORMAT [ARGUMENT]...

printf OPTION

[root@localhost doc]# printf "this year is 2017,the day is Feb 11"

this year is 2017,the day is Feb 11[root@localhost doc]#

file 判断文件类型

该命令用来识别文件类型,也可用来辨别一些文件的编码格式。它是通过查看文件的头部信息来获取文件类型,而不是像Windows通过扩展名来确定文件类型的。

NAME

file - determine file type

SYNOPSIS

file [-bchikLNnprsvz0] [--apple] [--mime-encoding] [--mime-type] [-e testname] [-F separator]

[-f namefile] [-m magicfiles] file ...

file -C [-m magicfiles]

file [--help]

ELF:可执行链接文件

[rhel@localhost ~]$ file /bin/ls

/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值