我注意到在Solaris ksh中支持tail +2,但是在Red Hat Linux中,会出现一个错误:tailcannot open `+2' for reading: No such file or directorybjbldd>> ps -p 2622,16589,11719,846 |tail但我想知道Linuxta
Linux命令是sudo parted /dev/sda unit s print free | tail -2。在我的例子中,它返回如下内容:我需要捕获第一个数字字符串和第二个数字字符串。我尝试使用grep,但我所能达到的最好结果是得到颜色匹配的数字,但它们不能在脚本中用作参数:
sudo parted /dev/sda unit s