Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何使用基于最后一个整数的“排序”对字符串文件进行排序?_Linux_Sorting_Ubuntu_Unix_Terminal - Fatal编程技术网

Linux 如何使用基于最后一个整数的“排序”对字符串文件进行排序?

Linux 如何使用基于最后一个整数的“排序”对字符串文件进行排序?,linux,sorting,ubuntu,unix,terminal,Linux,Sorting,Ubuntu,Unix,Terminal,文件= 嗨,你去哪里 Yes No'1 a s k j 2 A B 3 我想要的答案是: 嗨,你去哪里 A B 3 a s k j 2 你的问题得到了回答: 安德烈 awk '{print $NF,$0}' file.txt | sort -nr | cut -f2- -d' '

文件= 嗨,你去哪里

Yes No'1

a s k j 2

A B 3

我想要的答案是:

嗨,你去哪里

A B 3

a s k j 2

你的问题得到了回答:

安德烈

awk '{print $NF,$0}' file.txt | sort -nr | cut -f2- -d' '