Text Viewing Issues in SSH

Hi,

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.
ssh.png
ChiehkaiAsked:
Who is Participating?
 
Monis MontherConnect With a Mentor System 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
0
 
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

0
 
tty2Commented:
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.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ChiehkaiAuthor Commented:
Hi,

Sorry I forgot to mention the problem. I want to know how to view the entire command.
0
 
Monis MontherSystem ArchitectCommented:
Did you check my solution number 1

0
 
ChiehkaiAuthor Commented:
Hi,

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".

Thanks.
0
 
netbuzzCommented:
Try htop as told y small_student. It is a nice tool
0
 
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
0
 
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?

Thanks.
0
All Courses

From novice to tech pro — start learning today.