Linux中的echo命令可以使用一些選項來控制輸出格式,以下是一些常用的選項:
echo -n "Hello, "
echo "World!"
echo -e "Line 1\nLine 2"
echo -E "This is a \n test"
echo "This is a \n test"
printf "%-10s %-10s\n" "Name" "Age"
printf "%-10s %-10s\n" "Alice" "25"
printf "%-10s %-10s\n" "Bob" "30"
通過以上方法,可以在Linux中使用echo命令來控制輸出格式。