Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-22-2013, 02:43 AM   #1
LQ Newbie
Registered: Nov 2012
Posts: 9

Rep: Reputation: Disabled
Current Session Command

Dear All,

I want to display the command related to current session in Redhat Linux 5.
Below history command display all the command in ~/.bash_history file.


My requirement is the command executed in my current session.I mean to say.

Suppose after log in as root i executed

df -TH
pgrep jboss
pgrep smon
pgrep pmon
pgrep ftpd

Is there any procedure which will display only above FIVE(5) command in my current session.

Thanks and Regards
Monoj Das
Old 02-22-2013, 02:58 AM   #2
Registered: Nov 2012
Location: India
Distribution: Fedora, CentOs, RHEL
Posts: 164

Rep: Reputation: 24
Hi monojcool,

Do you mean, you want to get the list of commands executed by some other user?
Old 02-22-2013, 03:09 AM   #3
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
When you switch to a different user, the commands history gets saved in that user's ~/.bash_history file. Even before exiting the session, you can invoke history cmd to get a list of all cmds invoked.
Old 02-22-2013, 03:59 AM   #4
Senior Member
Registered: Apr 2010
Posts: 1,541

Rep: Reputation: 262Reputation: 262Reputation: 262
check out this thread:

or try this:

Change bash history file size

If you want to change bash history file size open up your .bashrc using the following command from your terminal

gedit ~/.bashrc

Now add the following line at the top

export HISTFILESIZE=3000

Save and exit the file

from this link:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
nvidia problem when ending current session farmerdave Slackware 4 09-15-2008 04:27 AM
Vncserver and Viewing Current User Session metallica1973 Linux - Networking 1 08-26-2008 08:28 PM
vnc into current console session syntacticalerror Linux - Newbie 1 07-05-2008 11:32 PM
viewing current session in VNC metallica1973 Linux - Software 2 07-21-2006 01:53 PM
Lock the current terminal session? kipbenson4 Linux - Newbie 1 08-14-2003 10:04 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration