Showing posts with label red hat. Show all posts
Showing posts with label red hat. Show all posts

Monday, November 14, 2016

Clear the Command History of your Terminal on Linux

You may have a lots of command in your shells history. You can display your shell commands history by running the following command,

history
    1  history
    2  lscpu
    3  history

This is the output of the history command of my Ubuntu computer. In real scenario you may have hundreds of commands on the history.

To clear the command history of your terminal on Linux, run the following command,

history -c

That's how you remove the history of your shell on Linux.

Thursday, October 13, 2016

See The Users that have Running Processes on Linux System

Hi,

Today I am gonna write about how to see the users on your Linux system that are running some processes.

I have a YouTube video about this post. Check it out if you wish.

YouTube : See The Users that have Running Processes on Linux System



The command is,

sudo ps aux | awk '{print $1}' | sort | uniq | grep -v USER

Explanation

sudo ps aux is used to list the running processes of the system.

awk '{print $1}' is used to print only the first column from the output of sudo ps aux

sort is used to sort the output.

uniq is used to get only the unique lines.

grep -v USER is used to remove the line that contains the field name USER.

Thank you for the visit. :-)