LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-22-2013, 01:43 AM   #1
monojcool
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.

$history

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, 01:58 AM   #2
RaviTezu
Member
 
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, 02:09 AM   #3
shivaa
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, 02:59 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,167

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
check out this thread: http://www.linuxquestions.org/questi...-limit-775909/

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: http://www.ubuntugeek.com/how-to-vie...in-ubuntu.html
 
  


Reply



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 03:27 AM
Vncserver and Viewing Current User Session metallica1973 Linux - Networking 1 08-26-2008 07:28 PM
vnc into current console session syntacticalerror Linux - Newbie 1 07-05-2008 10:32 PM
viewing current session in VNC metallica1973 Linux - Software 2 07-21-2006 12:53 PM
Lock the current terminal session? kipbenson4 Linux - Newbie 1 08-14-2003 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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