나는 지금 막 붙어있어서 도움이 필요하다. 나는 다음과 같은 명령을 실행하고 있습니다 :새 줄을 파일로 출력하지 않는 배쉬 (Bash) 출력
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 왜 직접 에코 대신 에코 $ (어떤 명령)를 사용합니까?/ –