私は現時点で詰まっており、何か助けてください。離れたラインでその出力ラインを持つのがあれば、私は疑問に思ってファイルの出力に改行がありません
echo $(ps aux |sort -nrk 3,3 | head -n 10) > text.txt
そして、私は取得しています出力はすべて一つの大きなブロックに
student 2066 16.5 7.4 1609208 299500 ? Ssl 07:31 12:16 compiz student 2803 13.3 8.3 2261736 339840 ? Sl 07:33 9:40 /usr/lib/firefox/plugin-container -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 2720 true tab student 2720 6.5 9.1 2435552 370424 ? Sl 07:33 4:47 /usr/lib/firefox/firefox root 884 5.3 2.8 365268 116248 tty7 Ssl+ 07:31 4:02 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch student 2700 0.6 1.1 801556 46540 ? Sl 07:33 0:26 /usr/bin/gedit --gapplication-service student 2023 0.1 3.4 1312876 138932 ? Sl 07:31 0:05 /usr/bin/gnome-software --gapplication-service student 2017 0.1 1.3 832524 55068 ? Sl 07:31 0:04 nautilus -n student 1337 0.1 0.0 116164 2084 ? Sl 07:31 0:07 /usr/bin/VBoxClient --draganddrop whoopsie 592 0.0 0.3 373952 12352 ? Ssl 07:30 0:00 /usr/bin/whoopsie -f USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
です:私は、次のコマンドを実行しています。
student 2066 16.5 7.4 1609208 299500 ? Ssl 07:31 12:16 compiz
student 2803 13.3 8.3 2261736 339840 ? Sl 07:33 9:40 /usr/lib/firefox/plugin-container -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 2720 true tab
student 2720 6.5 9.1 2435552 370424 ? Sl 07:33 4:47 /usr/lib/firefox/firefox root 884 5.3 2.8 365268 116248 tty7 Ssl+ 07:31 4:02 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch student 2700 0.6 1.1 801556 46540 ? Sl 07:33 0:26 /usr/bin/gedit --gapplication-service student 2023 0.1 3.4 1312876 138932 ? Sl 07:31 0:05 /usr/bin/gnome-software --gapplication-service student 2017 0.1 1.3 832524 55068 ? Sl 07:31 0:04 nautilus -n
student 1337 0.1 0.0 116164 2084 ? Sl 07:31 0:07 /usr/bin/VBoxClient --draganddrop whoopsie 592 0.0 0.3 373952 12352 ? Ssl 07:30 0:00 /usr/bin/whoopsie -f USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
私はそれは私が現時点で自分自身を教えていますし、任意の助けをいただければ幸いです何であるとして、BASHでそれを行うために探しています。
'ps aux | sort -nrk 3,3 | head -n 10> text.txt' – hek2mgl
@Matthew Swart私は本当になぜそれらを直接使うのではなく、echo $(コマンド)を使うのだろうと思っています/ –