Sort ps result but with the first row instantly unchangedChange the Sort order of Devices in NautilusSort lines in text file with specific separator in LinuxSorting two columns with sort and uniqHow to sort the files in the download folder by date of download?sorting a file using the sort command and overwrite itsort a file based on the field 3 of the file contentsReverse column output with sort commandWhy are the outputs of `sort`, `sort k 1`, `sort k 1,1` equal?How to sort a file with bashusing sort command while strings in first column repeats

Signed and unsigned numbers

What's the "normal" opposite of flautando?

What are some noteworthy "mic-drop" moments in math?

Latex does not go to next line

If I receive an SOS signal, what is the proper response?

How to secure an aircraft at a transient parking space?

How are showroom/display vehicles prepared?

Difference on montgomery curve equation between EFD and RFC7748

Is it necessary to separate DC power cables and data cables?

Did Carol Danvers really receive a Kree blood tranfusion?

Meaning of ちはース as an exclamation

How do I express some one as a black person?

PTIJ: wiping amalek’s memory?

Motivation for Zeta Function of an Algebraic Variety

Do items de-spawn in Diablo?

Recommendation letter by significant other if you worked with them professionally?

In the quantum hamiltonian, why does kinetic energy turn into an operator while potential doesn't?

How can I get players to stop ignoring or overlooking the plot hooks I'm giving them?

In the late 1940’s to early 1950’s what technology was available that could melt a LOT of ice?

Filtering SOQL results with optional conditionals

What problems would a superhuman have whose skin is constantly hot?

Database Backup for data and log files

Word for a person who has no opinion about whether god exists

Could you please stop shuffling the deck and play already?



Sort ps result but with the first row instantly unchanged


Change the Sort order of Devices in NautilusSort lines in text file with specific separator in LinuxSorting two columns with sort and uniqHow to sort the files in the download folder by date of download?sorting a file using the sort command and overwrite itsort a file based on the field 3 of the file contentsReverse column output with sort commandWhy are the outputs of `sort`, `sort k 1`, `sort k 1,1` equal?How to sort a file with bashusing sort command while strings in first column repeats













0















I want to sort all the processes by Memory



me@host:~$ ps au | sort -r -k 5 | head -10 | sed "s/$USER/me/g"
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
me 2312 0.0 0.1 958148 5568 tty2 Sl+ Mar11 0:00 /usr/lib/evolution/evolution-data-server/evolution-alarm-notify
me 2232 0.0 0.2 957248 7912 tty2 Sl+ Mar11 0:01 /usr/lib/gnome-settings-daemon/gsd-media-keys
me 2292 0.0 0.3 949556 11924 tty2 Sl+ Mar11 0:15 nautilus-desktop
me 3308 0.0 0.0 918708 2596 pts/0 Sl Mar11 0:04 /home/me/.lantern/bin/lantern
me 4728 0.1 0.5 872048 21648 tty2 Sl+ Mar11 1:00 gnome-control-center
me 2223 0.0 0.2 833712 8656 tty2 Sl+ Mar11 0:04 /usr/lib/gnome-settings-daemon/gsd-color
me 14638 0.0 0.2 83136 10400 pts/0 S+ 13:25 0:00 aria2c https://repo.anaconda.com/archive/Anaconda3-2018.12-MacOSX-x86_64.pkg
me 1799 1.8 1.2 745516 49592 tty2 Sl+ Mar11 17:36 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
me 3587 0.0 0.4 736908 16952 tty2 Sl+ Mar11 0:32 /opt/google/chrome/chrome --type=renderer --field-trial-handle=9889395698754715859,17788752790984658481,131072 --service-pipe-token=121279454012343526 --lang=en-US --enable-crash-reporter=41f7a813-8595-4f48-8ba9-5b4493af761c, --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=121279454012343526 --renderer-client-id=22 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100,v8_natives_data:101


Observe the 5th field, 83136 is judged greater than 745515



I add '--numeric-sort'



me@host:~$ ps au | sort -rn -k 5 | head -10 | sed "s/$USER/me/g"
me 2048 1.3 3.6 3324476 143932 tty2 Sl+ Mar11 12:30 /usr/bin/gnome-shell
me 3323 0.7 5.3 2110972 210872 pts/0 Sl Mar11 6:54 /home/me/.lantern/bin/lantern
me 3217 0.1 3.1 1834724 124076 tty2 Sl+ Mar11 1:02 /opt/google/chrome/chrome --type=renderer --field-trial-handle=9889395698754715859,17788752790984658481,131072 --service-pipe-token=14274241015953851945 --lang=en-US --enable-crash-reporter=41f7a813-8595-4f48-8ba9-5b4493af761c, --extension-process --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=14274241015953851945 --renderer-client-id=5 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
me 2932 1.0 4.3 1463616 172764 tty2 SLl+ Mar11 9:54 /opt/google/chrome/chrome
me 2700 0.0 2.3 1263084 93984 tty2 SLl+ Mar11 0:14 /usr/bin/gnome-software --gapplication-service
me 2312 0.0 0.1 958148 5568 tty2 Sl+ Mar11 0:00 /usr/lib/evolution/evolution-data-server/evolution-alarm-notify
me 2232 0.0 0.1 957248 7632 tty2 Sl+ Mar11 0:01 /usr/lib/gnome-settings-daemon/gsd-media-keys
me 2292 0.0 0.6 949556 26132 tty2 Sl+ Mar11 0:15 nautilus-desktop
me 3308 0.0 0.0 918708 2584 pts/0 Sl Mar11 0:04 /home/me/.lantern/bin/lantern
me 4728 0.1 0.5 872048 21588 tty2 Sl+ Mar11 1:00 gnome-control-center


but the leading captain description disappears



How could I sort the output but instantly allow the first row take the lead?









share


























    0















    I want to sort all the processes by Memory



    me@host:~$ ps au | sort -r -k 5 | head -10 | sed "s/$USER/me/g"
    USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
    me 2312 0.0 0.1 958148 5568 tty2 Sl+ Mar11 0:00 /usr/lib/evolution/evolution-data-server/evolution-alarm-notify
    me 2232 0.0 0.2 957248 7912 tty2 Sl+ Mar11 0:01 /usr/lib/gnome-settings-daemon/gsd-media-keys
    me 2292 0.0 0.3 949556 11924 tty2 Sl+ Mar11 0:15 nautilus-desktop
    me 3308 0.0 0.0 918708 2596 pts/0 Sl Mar11 0:04 /home/me/.lantern/bin/lantern
    me 4728 0.1 0.5 872048 21648 tty2 Sl+ Mar11 1:00 gnome-control-center
    me 2223 0.0 0.2 833712 8656 tty2 Sl+ Mar11 0:04 /usr/lib/gnome-settings-daemon/gsd-color
    me 14638 0.0 0.2 83136 10400 pts/0 S+ 13:25 0:00 aria2c https://repo.anaconda.com/archive/Anaconda3-2018.12-MacOSX-x86_64.pkg
    me 1799 1.8 1.2 745516 49592 tty2 Sl+ Mar11 17:36 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
    me 3587 0.0 0.4 736908 16952 tty2 Sl+ Mar11 0:32 /opt/google/chrome/chrome --type=renderer --field-trial-handle=9889395698754715859,17788752790984658481,131072 --service-pipe-token=121279454012343526 --lang=en-US --enable-crash-reporter=41f7a813-8595-4f48-8ba9-5b4493af761c, --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=121279454012343526 --renderer-client-id=22 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100,v8_natives_data:101


    Observe the 5th field, 83136 is judged greater than 745515



    I add '--numeric-sort'



    me@host:~$ ps au | sort -rn -k 5 | head -10 | sed "s/$USER/me/g"
    me 2048 1.3 3.6 3324476 143932 tty2 Sl+ Mar11 12:30 /usr/bin/gnome-shell
    me 3323 0.7 5.3 2110972 210872 pts/0 Sl Mar11 6:54 /home/me/.lantern/bin/lantern
    me 3217 0.1 3.1 1834724 124076 tty2 Sl+ Mar11 1:02 /opt/google/chrome/chrome --type=renderer --field-trial-handle=9889395698754715859,17788752790984658481,131072 --service-pipe-token=14274241015953851945 --lang=en-US --enable-crash-reporter=41f7a813-8595-4f48-8ba9-5b4493af761c, --extension-process --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=14274241015953851945 --renderer-client-id=5 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
    me 2932 1.0 4.3 1463616 172764 tty2 SLl+ Mar11 9:54 /opt/google/chrome/chrome
    me 2700 0.0 2.3 1263084 93984 tty2 SLl+ Mar11 0:14 /usr/bin/gnome-software --gapplication-service
    me 2312 0.0 0.1 958148 5568 tty2 Sl+ Mar11 0:00 /usr/lib/evolution/evolution-data-server/evolution-alarm-notify
    me 2232 0.0 0.1 957248 7632 tty2 Sl+ Mar11 0:01 /usr/lib/gnome-settings-daemon/gsd-media-keys
    me 2292 0.0 0.6 949556 26132 tty2 Sl+ Mar11 0:15 nautilus-desktop
    me 3308 0.0 0.0 918708 2584 pts/0 Sl Mar11 0:04 /home/me/.lantern/bin/lantern
    me 4728 0.1 0.5 872048 21588 tty2 Sl+ Mar11 1:00 gnome-control-center


    but the leading captain description disappears



    How could I sort the output but instantly allow the first row take the lead?









    share
























      0












      0








      0








      I want to sort all the processes by Memory



      me@host:~$ ps au | sort -r -k 5 | head -10 | sed "s/$USER/me/g"
      USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
      me 2312 0.0 0.1 958148 5568 tty2 Sl+ Mar11 0:00 /usr/lib/evolution/evolution-data-server/evolution-alarm-notify
      me 2232 0.0 0.2 957248 7912 tty2 Sl+ Mar11 0:01 /usr/lib/gnome-settings-daemon/gsd-media-keys
      me 2292 0.0 0.3 949556 11924 tty2 Sl+ Mar11 0:15 nautilus-desktop
      me 3308 0.0 0.0 918708 2596 pts/0 Sl Mar11 0:04 /home/me/.lantern/bin/lantern
      me 4728 0.1 0.5 872048 21648 tty2 Sl+ Mar11 1:00 gnome-control-center
      me 2223 0.0 0.2 833712 8656 tty2 Sl+ Mar11 0:04 /usr/lib/gnome-settings-daemon/gsd-color
      me 14638 0.0 0.2 83136 10400 pts/0 S+ 13:25 0:00 aria2c https://repo.anaconda.com/archive/Anaconda3-2018.12-MacOSX-x86_64.pkg
      me 1799 1.8 1.2 745516 49592 tty2 Sl+ Mar11 17:36 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
      me 3587 0.0 0.4 736908 16952 tty2 Sl+ Mar11 0:32 /opt/google/chrome/chrome --type=renderer --field-trial-handle=9889395698754715859,17788752790984658481,131072 --service-pipe-token=121279454012343526 --lang=en-US --enable-crash-reporter=41f7a813-8595-4f48-8ba9-5b4493af761c, --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=121279454012343526 --renderer-client-id=22 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100,v8_natives_data:101


      Observe the 5th field, 83136 is judged greater than 745515



      I add '--numeric-sort'



      me@host:~$ ps au | sort -rn -k 5 | head -10 | sed "s/$USER/me/g"
      me 2048 1.3 3.6 3324476 143932 tty2 Sl+ Mar11 12:30 /usr/bin/gnome-shell
      me 3323 0.7 5.3 2110972 210872 pts/0 Sl Mar11 6:54 /home/me/.lantern/bin/lantern
      me 3217 0.1 3.1 1834724 124076 tty2 Sl+ Mar11 1:02 /opt/google/chrome/chrome --type=renderer --field-trial-handle=9889395698754715859,17788752790984658481,131072 --service-pipe-token=14274241015953851945 --lang=en-US --enable-crash-reporter=41f7a813-8595-4f48-8ba9-5b4493af761c, --extension-process --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=14274241015953851945 --renderer-client-id=5 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
      me 2932 1.0 4.3 1463616 172764 tty2 SLl+ Mar11 9:54 /opt/google/chrome/chrome
      me 2700 0.0 2.3 1263084 93984 tty2 SLl+ Mar11 0:14 /usr/bin/gnome-software --gapplication-service
      me 2312 0.0 0.1 958148 5568 tty2 Sl+ Mar11 0:00 /usr/lib/evolution/evolution-data-server/evolution-alarm-notify
      me 2232 0.0 0.1 957248 7632 tty2 Sl+ Mar11 0:01 /usr/lib/gnome-settings-daemon/gsd-media-keys
      me 2292 0.0 0.6 949556 26132 tty2 Sl+ Mar11 0:15 nautilus-desktop
      me 3308 0.0 0.0 918708 2584 pts/0 Sl Mar11 0:04 /home/me/.lantern/bin/lantern
      me 4728 0.1 0.5 872048 21588 tty2 Sl+ Mar11 1:00 gnome-control-center


      but the leading captain description disappears



      How could I sort the output but instantly allow the first row take the lead?









      share














      I want to sort all the processes by Memory



      me@host:~$ ps au | sort -r -k 5 | head -10 | sed "s/$USER/me/g"
      USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
      me 2312 0.0 0.1 958148 5568 tty2 Sl+ Mar11 0:00 /usr/lib/evolution/evolution-data-server/evolution-alarm-notify
      me 2232 0.0 0.2 957248 7912 tty2 Sl+ Mar11 0:01 /usr/lib/gnome-settings-daemon/gsd-media-keys
      me 2292 0.0 0.3 949556 11924 tty2 Sl+ Mar11 0:15 nautilus-desktop
      me 3308 0.0 0.0 918708 2596 pts/0 Sl Mar11 0:04 /home/me/.lantern/bin/lantern
      me 4728 0.1 0.5 872048 21648 tty2 Sl+ Mar11 1:00 gnome-control-center
      me 2223 0.0 0.2 833712 8656 tty2 Sl+ Mar11 0:04 /usr/lib/gnome-settings-daemon/gsd-color
      me 14638 0.0 0.2 83136 10400 pts/0 S+ 13:25 0:00 aria2c https://repo.anaconda.com/archive/Anaconda3-2018.12-MacOSX-x86_64.pkg
      me 1799 1.8 1.2 745516 49592 tty2 Sl+ Mar11 17:36 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
      me 3587 0.0 0.4 736908 16952 tty2 Sl+ Mar11 0:32 /opt/google/chrome/chrome --type=renderer --field-trial-handle=9889395698754715859,17788752790984658481,131072 --service-pipe-token=121279454012343526 --lang=en-US --enable-crash-reporter=41f7a813-8595-4f48-8ba9-5b4493af761c, --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=121279454012343526 --renderer-client-id=22 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100,v8_natives_data:101


      Observe the 5th field, 83136 is judged greater than 745515



      I add '--numeric-sort'



      me@host:~$ ps au | sort -rn -k 5 | head -10 | sed "s/$USER/me/g"
      me 2048 1.3 3.6 3324476 143932 tty2 Sl+ Mar11 12:30 /usr/bin/gnome-shell
      me 3323 0.7 5.3 2110972 210872 pts/0 Sl Mar11 6:54 /home/me/.lantern/bin/lantern
      me 3217 0.1 3.1 1834724 124076 tty2 Sl+ Mar11 1:02 /opt/google/chrome/chrome --type=renderer --field-trial-handle=9889395698754715859,17788752790984658481,131072 --service-pipe-token=14274241015953851945 --lang=en-US --enable-crash-reporter=41f7a813-8595-4f48-8ba9-5b4493af761c, --extension-process --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --num-raster-threads=2 --enable-main-frame-before-activation --service-request-channel-token=14274241015953851945 --renderer-client-id=5 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
      me 2932 1.0 4.3 1463616 172764 tty2 SLl+ Mar11 9:54 /opt/google/chrome/chrome
      me 2700 0.0 2.3 1263084 93984 tty2 SLl+ Mar11 0:14 /usr/bin/gnome-software --gapplication-service
      me 2312 0.0 0.1 958148 5568 tty2 Sl+ Mar11 0:00 /usr/lib/evolution/evolution-data-server/evolution-alarm-notify
      me 2232 0.0 0.1 957248 7632 tty2 Sl+ Mar11 0:01 /usr/lib/gnome-settings-daemon/gsd-media-keys
      me 2292 0.0 0.6 949556 26132 tty2 Sl+ Mar11 0:15 nautilus-desktop
      me 3308 0.0 0.0 918708 2584 pts/0 Sl Mar11 0:04 /home/me/.lantern/bin/lantern
      me 4728 0.1 0.5 872048 21588 tty2 Sl+ Mar11 1:00 gnome-control-center


      but the leading captain description disappears



      How could I sort the output but instantly allow the first row take the lead?







      sort





      share












      share










      share



      share










      asked 4 mins ago









      AliceAlice

      450110




      450110




















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1124935%2fsort-ps-result-but-with-the-first-row-instantly-unchanged%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1124935%2fsort-ps-result-but-with-the-first-row-instantly-unchanged%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

          Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

          Antonio De Lisio Carrera Referencias Menú de navegación«Caracas: evolución relacional multipleja»«Cuando los gobiernos subestiman a las localidades: L a Iniciativa para la Integración de la Infraestructura Regional Suramericana (IIRSA) en la frontera Colombo-Venezolana»«Maestría en Planificación Integral del Ambiente»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«Conózcanos»«Caracas: evolución relacional multipleja»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»