2

I am facing a weird error when I attempt to invoke "top"

myhost:~> top

top: unknown option '1'

Usage: top -hv | -bcHiOSs -d secs -n max -u|U user -p pid(s) -o field -w [cols]

myhost:~>

I am connected to the server "myhost" via SSH. I looked it up online and found no help...

EDIT: As far as I remember, I have not manipulated this command in any way. The command \top works.

5
  • 2
    If this is on Linux, then see if you have a .toprc file in your home directory, and remove or temporarily rename it. Then try again.
    – Kusalananda
    Commented Nov 3, 2017 at 10:59
  • 1
    To ignore aliases, try "top" or \top. Also explain what did you do before you broke it. Out of the box, top works fine. Commented Nov 3, 2017 at 11:08
  • I do not have a .toprc file. Also, \top works.
    – TheNotMe
    Commented Nov 3, 2017 at 11:10
  • 1
    Chances are that your machine has been compromised! and top has been replaced with a custom top command which is probably hiding trojans, viruses and whatnot! Commented Nov 3, 2017 at 11:16
  • 1
    No it is ok. This is a university-managed server. The IT people do things all the time. Thanks for the heads up, though.
    – TheNotMe
    Commented Nov 3, 2017 at 11:16

1 Answer 1

2

You may have the top replaced with alias of the same name. Check your aliases:

[kucera@node ~]$ alias
...
alias top='top 1'
...

If you see something like in the example above, you have the problem identified. Then you have to modify your profile settings (if it wasn't just temporary alias).

7
  • I have the alias: top top -s 1. How can I fix this?
    – TheNotMe
    Commented Nov 3, 2017 at 11:10
  • Remove the 1 so you have just 'top -s' in your alias. Commented Nov 3, 2017 at 11:12
  • I do realize that. The question is how do I do that? I have no .bashrc file in my home directory.
    – TheNotMe
    Commented Nov 3, 2017 at 11:15
  • 2
    Then it's possibly system wide. Grep content of /etc/profile.d, /etc/profile, /etc/bashrc Commented Nov 3, 2017 at 11:20
  • 1
    If you don't have access there, you can fix it with 'unalias top' in your ~/.bashrc Commented Nov 3, 2017 at 11:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .