bash history buffer cache


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bash history buffer cache
# 1  
Old 01-06-2012
bash history buffer cache

Moderators,
Please excuse if I am in the wrong section.

I have a question that someone may know the answer to. We know that a current bash shell keeps a record of all commands in a buffer. When the shell is terminated this buffer is written out to ~/.bash_history for the user.

I know that in the current shell, you can access this buffer by using ctrl r for reverse history. That's fine if you are the user in that shell.
The question that I have is:

As root user, can I access that buffer of another shell open on the system? Perhaps in the /proc/pid format of some sort?

Any help is appreciated.

jaysunn
# 2  
Old 01-06-2012
From the outside? No.

You could look at the process' raw memory contents, but that's akin to trying to read a hard drive with an electron microscope.

Since you're root, though, why not just kill their shell, then grab the history?
# 3  
Old 01-06-2012
@corona688,
Yes I could kill the shell and grab the history. Just wondered if a less barbaric approach was available.

Thanks,
jaysunn
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Deciding whether to get a buffer cache block or inode block

I was reading a book on UNIX internals "The design of the UNIX Operating system." There are two memory structures that are confusing me: 1) Buffer cache 2) Inode cache My questions are 1) Does a process get both buffer cache and Indoe cache allocated when it opens/creates a file? 2) if no,... (1 Reply)
Discussion started by: sreeharshasn
1 Replies

2. Linux

File cache /Page cache Linux

Hi All, could any one point out any open source test-suites for "File cache" testing and as well as performance test suites for the same. Currently my system is up with Linux/ext4. Regards Manish (0 Replies)
Discussion started by: hmanish
0 Replies

3. Linux

getting info on Cache Size, Data Cache etc..

Hi all I saw in Microsoft web site www.SysInternals.com a tool called CoreInfo from able to print out on screen the size of the Data and Instruction caches of your processor, the Locigal to Physical Processor mapping, the number of the CPU sockets. etc.. Do you know if in Linux is available a... (2 Replies)
Discussion started by: manustone
2 Replies

4. Filesystems, Disks and Memory

Buffer Cache Stats from /proc/meminfo

Hi, I am trying to understand the role of buffer cache in block I/O. I am monitoring /proc/meminfo, my question is does the value of 0 for 'buffers', mean that any subsequent disk read issued by a process, would get the data physically from the disk, and not an allocated buffer for the block? ... (1 Reply)
Discussion started by: jake24
1 Replies

5. UNIX for Dummies Questions & Answers

reduce buffer cache allocation?

Hi, Is it possible to reduce the amount of buffer cache in the memory allocation of a Unix Server? If so where can I do that? Also, does buffer cache count as tied up memory, or will it decrease as more memory is requested by other programs. (1 Reply)
Discussion started by: dehuang83
1 Replies

6. Red Hat

buffer cache size

hi everyone, can any one help change the buffer cache size in redhat and suse?? this error i got when i installed oracle 10g and it went well and when i try to mount the database using startup cmd it says too many buffer cache parameters (error code : ora-1034) thnq in advance (0 Replies)
Discussion started by: gsr_kashyap
0 Replies

7. Solaris

Unix Cache / Buffer

Does anyone know how the unix buffer / cache is set in a Solaris based system ? ( I presume it is a kernel based setting ) I notice from SAR -d that my read cache is consistently at 100% but my write cache frequently falls below 65%. What does this mean. Should I be tuning the write cache and... (1 Reply)
Discussion started by: jimthompson
1 Replies

8. HP-UX

Buffer Cache

What is the "Buffer Cache" used for? (1 Reply)
Discussion started by: ALTRUNVRSOFLN
1 Replies

9. UNIX for Advanced & Expert Users

vm and buffer cache

i have a serious doubht about the assignment of memory in hp-ux system . i read from somewhere that the page allocation in hp-ux is not unified unlike compaq . i wanted to know in hp-ux kernel ,once the pages are assigned for the univarsal buffer cache... (2 Replies)
Discussion started by: vish_shan
2 Replies

10. Filesystems, Disks and Memory

buffer cache information

anybody please tell me how do i get all the information about buffer cache in hp-ux .if anybody familiar with the system call them please specify . i found the extern variables in /sys/buf.h . but that didn't help .:) (2 Replies)
Discussion started by: vish_shan
2 Replies
Login or Register to Ask a Question