Text Viewing Issues in SSH


When I was monitoring my server's process using the "top -c" command, I noticed that a few processes weren't displayed entirely, looks like there isn't enough room for the entire line.

Please check the screenshot below, I have marked the lines mentioned in red.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Monis MontherSystem ArchitectCommented:
So whats the problem , the part you are not seeing is the rest of the command that started the corresponding process.

1- you can do

ps ax |grep pid

This will give you the full command

2- You can download and install htop

htop is similar to top but gives you some colors and helps you scroll down with the arrow keys to see all process on the system

I suppose, the question is to see whole line, isn't it?
You can retrieve a lot of info about process from /proc/<PID>/ directory:

cat /proc/9582/cmdline

, for example.
ChiehkaiAuthor Commented:

Sorry I forgot to mention the problem. I want to know how to view the entire command.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Monis MontherSystem ArchitectCommented:
Did you check my solution number 1

ChiehkaiAuthor Commented:

Yes, It did show the full processes with command "ps ax |grep pid" but is that real time? Looks like it doesn't update like "top".

Try htop as told y small_student. It is a nice tool
Monis MontherSystem ArchitectCommented:
No this is not real time, but the command never changes, if it does then the process will change too.

You can do something like this

watch -n 1 'ps ax |grep pid'

This will act as if you are running the command every 1 second thus real time

Note: these are single quotes around the ps ax|grep pid not double quotes
ChiehkaiAuthor Commented:
Thanks small_student, just another thing.

May I know whats the difference between ps -aux and ps ax |grep pid?

And if I want to log output of ps ax |grep pid every minute, what command should I enter in crontab?

Monis MontherSystem ArchitectCommented:
ps is the command that shows processes on the system the a u and x are switches

a means all process in all terminals
x means all process in the background
u adds the owner of the process for you ( the account that started the process)

so the difference is the u switch which adds the user

Now when run any of them all process in your system will show on the screen because both include the switches a and x this output will scroll down 2-3 screens so if you want to view a certain process instead od showing them all and looking by your eye we added the | grep pid

grep is a tool that searches text under a file or if you put it after a | it will search through the output of that command

To understand more about | read about Pipes and I/O channels
To know more about the ps command

man ps

Hope this helps a bit

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.