LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 12-06-2011, 12:47 AM   #1
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Deleting particular date's history command.


Friends,

I have a problem to discuss with you.

I want to delete particular date's history commands and when I run back the history command it should not show the delted history command. How to do this?

I will be very thankful to you for this.
 
Old 12-06-2011, 01:38 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

On a standard installation the history commands doesn't show date information. Did you use something like HISTTIMEFORMAT to include that info in the command history? If so, then you could use sed/awk to do what you want. If not, then you can edit the .bash_history file for your user manually. If you could specify a bit more to why and what you want to remove from your history file and what OS you're using we might be able to provide more dedicated help.

Kind regards,

Eric
 
Old 12-06-2011, 02:10 AM   #3
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Original Poster
Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
I'm using RHEL5.3 and want to delete some of the history commands so that other users accessing the machine won't be able to see what command I run.
 
Old 12-06-2011, 02:18 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Other users accessing the same machine but with a different user id don't have access to your history file unless they have the permissions granted by either you or root. You could always copy your history file to your local computer and clear out the history entirely before logging out. And why are you afraid that others might see what commands you use? It's all common knowledge and what you know can be found on the internet pretty easy. I can only hope you're not referring to the root user being shared with multiple users. Root usage should be limited to a strict minimum.

Kind regards,

Eric
 
Old 12-06-2011, 02:25 AM   #5
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Original Poster
Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Because there are some other users who have the permission to login with the root user. And I don't have permission to delete history commands.
 
Old 12-06-2011, 02:30 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Then you either ask to be granted the permissions necessary or stop trying to bypass security. It's there for a reason you know. If you don't want others, who have been granted root access to see what commands you run, then I can only assume that you're trying to hide something from them. Either way, in my personal opinion, you're not working in a professional way, no insult intended.

Kind regards,

Eric
 
Old 12-06-2011, 02:40 AM   #7
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Original Poster
Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Yes I want to hide some of the things and I'm working in a professional way. There are some of the things which need to hide from them. And my senior told me to do this, that's why I'm doing this, otherwise there is no need to do this.

So please help me.

Ok, I used history -d 2003 to delete the line no. 2003 but when I again run history command it shows the command used to delete the previous command i.e., it shows history -d 2003. Now I want that it should no happen.
 
Old 12-06-2011, 02:45 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Now you've got me confused. First you state you don't have permission to delete history of commands and now you did delete one? If you do have permission to do it, then go the manual way or use what I indicated in post #2. Still not convinced though that this is the professional thing to do but hey, it's your history.

Kind regards,

Eric
 
Old 12-06-2011, 02:56 AM   #9
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Original Poster
Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Ofcourse I don't have permission to delete history commands but some of the traces should not be left behind, that's why we have to do something so that our super senior guy should not be able to see what we have done.

Ok, so deleting the line from .bash_history file do not show what we have deleted when we again run history command?
 
Old 12-06-2011, 03:09 AM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

I don't feel good at all with the fact that you're hiding stuff from your superiors for whatever reason you might have. So you're on your own for as far as I'm concerned.

Kind regards,

Eric
 
Old 12-06-2011, 04:31 AM   #11
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Original Poster
Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Eric,

There is no need to feel bad about this. Actually my senior told me to hide this from super-senior, that's why I have to do this. This is somehing sometimes which I and my colleague have to do this. There is no big issue for this my friend.

Last edited by Satyaveer Arya; 12-06-2011 at 04:37 AM.
 
Old 12-07-2011, 02:16 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Sorry - I didn't mention the reason for closure. If you're trying
to "cover your tracks" on a machine against the owners intended usage
you're in breach of our rules, and as such your thread is unacceptable.



Cheers,
Tink
 
  


Closed Thread



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
History with date and executed file/command wetech3 Linux - Newbie 1 02-17-2011 08:04 AM
History command with system date shipon_97 Linux - Newbie 5 12-26-2009 02:41 AM
Deleting history wincrk Linux - Newbie 1 05-14-2006 08:24 PM
History command, How to get the date? philipina Linux - General 2 08-05-2004 05:58 PM
Deleting pages in history that won't go away comp8824 Linux - Security 1 11-01-2002 10:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:26 PM.

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