1、使用echo如何显示“The year is 2017. Today is March 5.”为两行?
echo -e "The year is 2017 \nToday is March 5 "
The year is 2017
Today is March 5
\n这个回车指令不用后面加空格!如果加空格结果如下
echo -e "The year is 2017 \n Today is March 5 "
The year is 2017
Today is March 5
2、使用printf命令如何显示“The year is 2017. Today is March 5.”为两行?
printf "The year is 2017. \nToday is March 5.\n"
The year is 2017.
Today is March 5.
echo和printf的区别是echo默认不换行,需添加命令
3、通过man获得帮助,创建目录(如有精力,可以尝试只使用一次mkdir命令解决此问题)
(1)在/mnt下创建boot和sysroot;
mkdir /mnt/{boot,sysroot}
使用mkdir在同目录下创建多个目录
(2)在/mnt/boot下创建grub;
mkdir /mnt/boot/grub
(3)在/mnt/sysroot下创建proc, sys, bin, sbin, lib, usr, var, etc, dev, home, root, tmp
mkdir /mnt/sysroot/{proc,sys,bin,sbin,lib,usr,var,etc,dev,home,root,tmp}
a)在/mnt/sysroot/usr下创建bin, sbin, lib
mkdir /mnt/sysroot/usr/{bin,sbin,lib}
b)在/mnt/sysroot/lib下创建modules
mkdir /mnt/sysroot/lib/modules
c)在/mnt/sysroot/var下创建run, log, lock
mkdir /mnt/sysroot/var{run,log,lock}
d)在/mnt/sysroot/etc下创建init.d
mkdir /mnt/sysroot/etc/init.d