LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-15-2013, 01:55 PM   #1
suchit1991
LQ Newbie
 
Registered: Oct 2013
Location: mumbai
Distribution: centos
Posts: 3

Rep: Reputation: Disabled
how to delete single line in wtmp..plz suggest me


how to delete single line in wtmp..plz suggest me
 
Old 10-15-2013, 03:23 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,316

Rep: Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878
Quote:
Originally Posted by suchit1991 View Post
how to delete single line in wtmp..plz suggest me
You don't tell us what version/distro of Linux you're using, or what you're trying to accomplish, so it's hard to say. Typically, you don't remove just ONE line...you either clear the file out, or let it continue to grow.
 
Old 10-15-2013, 03:37 PM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
This one was already asked some time ago. The question posed by jschiwal rises again:
Quote:
Why do you want to edit wtmp?
 
1 members found this post helpful.
Old 10-15-2013, 11:24 PM   #4
suchit1991
LQ Newbie
 
Registered: Oct 2013
Location: mumbai
Distribution: centos
Posts: 3

Original Poster
Rep: Reputation: Disabled
Im using centos 5.5.. I know how to empty the file
.but I came to know that single line can be deleted...I have searched it bit inable to find the answer... im vry curious how it can be done..just give me the hint..i no that it is very imp file..
 
Old 10-16-2013, 09:38 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,316

Rep: Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878
Quote:
Originally Posted by suchit1991 View Post
Im using centos 5.5.. I know how to empty the file
.but I came to know that single line can be deleted...I have searched it bit inable to find the answer... im vry curious how it can be done..just give me the hint..i no that it is very imp file..
Spell out your words. And again, WHY do you want to do this?? The LQ rules are clear about hacking/cracking, and doing something like this could easily be to cover your trail if you logged into a system without authorization.

And if you really DID look on Google, you'd find plenty...I did quite easily.
 
Old 10-16-2013, 12:45 PM   #6
suchit1991
LQ Newbie
 
Registered: Oct 2013
Location: mumbai
Distribution: centos
Posts: 3

Original Poster
Rep: Reputation: Disabled
just for knowledge sake i wanted to no... As a linux admin im not able to find the answer from many days... plz if any one knows just suggest me...
 
Old 10-16-2013, 02:22 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,316

Rep: Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878Reputation: 3878
Quote:
Originally Posted by suchit1991 View Post
just for knowledge sake i wanted to no... As a linux admin im not able to find the answer from many days... plz if any one knows just suggest me...
AGAIN, you need to SPELL OUT YOUR WORDS; it is 'please', not 'plz'. And if you're a Linux administrator, and have been looking for 'many days'....you haven't been looking that hard. I found it in less than 1 second through a Google search. Try that.

Again, we are NOT going to help you with this...see previous statement about hacking/cracking, and the LQ Rules. You won't say WHY you want to do this, despite being asked. If this is just for your knowledge's sake, then researching it on your own will teach you a lot more.
 
Old 10-16-2013, 02:23 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,117

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
It's a binary file with fixed size records. See /usr/include/utmp.h. Trying to delete one "line" (record) with a text editor would be difficult. Doing that with a C program is trivial.
 
Old 10-16-2013, 05:00 PM   #9
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,662
Blog Entries: 10

Rep: Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075
Quote:
Originally Posted by suchit1991 View Post
how to delete single line in wtmp
Why?
 
  


Reply


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
Deleting a line in wtmp file yashfire007 Linux - Newbie 10 03-05-2016 04:09 PM
utmp and wtmp file delete can cause any issue prathamesh7478 Linux - Newbie 4 03-17-2013 06:21 AM
How to delete single line from file using line number. gajananh999 Linux - Newbie 1 08-13-2012 06:25 AM
[SOLVED] command to find and delete line in single shot. Sha_unix Linux - Newbie 3 11-14-2011 02:27 PM
Suggest me plz. ccalvin12 General 2 07-26-2005 04:03 PM


All times are GMT -5. The time now is 05:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration