Shell基础命令

echo

echo 打印输出命令

echo "Hello World"

启用特殊字符转换(\特殊字符)

echo -e "Column 1\tColumn 2"
# Column 1 Column 2

根据要求展示输入的前置部分

output the first part of files

展示前两行

ls -lh | head -2
# total 8
# drwxr-xr-x 5 macmini staff 170B Mar 3 17:06 Demos

# 其他方案
ls -lh | sed -n '1,2p'
# total 8
# drwxr-xr-x 5 macmini staff 170B Mar 3 17:06 Demos

Copyright © 2017 - 2024 鹧鸪天 All Rights Reserved.

skyline 保留所有权利