LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-08-2002, 04:29 PM   #1
mccareth
LQ Newbie
 
Registered: Apr 2002
Posts: 2

Rep: Reputation: 0
searching through a binary file


Hi there,

I'm pretty new to doing command line coding for Linux so if this is actually an easy question, please just bare with me. I'm trying to figure out how to search a binary file to find keywords, such as a person's last name a such. I'm not even sure if this is possible. I was trying to do it on the /var/log/wtmp and in the man pages it says that it is binary. If you could help out, I would be very appreciative.

-mccareth



:smash:
 
Old 04-08-2002, 04:45 PM   #2
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,245

Rep: Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903
You can use the strings command for this.

--jeremy
 
Old 04-08-2002, 05:27 PM   #3
mccareth
LQ Newbie
 
Registered: Apr 2002
Posts: 2

Original Poster
Rep: Reputation: 0
hmmm..

Hmmmm.... This doesn't seem to be what I'm looking for. the /var/log/wtmp is used to do the last command. I was hoping to be able to search that file for something like last month's log in entries. Unfortunately, last usually pulls up just the current months info. I want to get any month past from linux.
 
Old 04-08-2002, 05:51 PM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,245

Rep: Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903Reputation: 3903
Oh... you just said you wanted to search through a binary file.
Your wtmp probably got rotated. Go to /var/log and look for wtmp.1 (or something similar). Then type "last -f wtmp.1".

--jeremy
 
  


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
searching a file in my hardisk... itz2000 Linux - Newbie 1 10-31-2005 12:45 PM
File Searching gfrair Linux - Newbie 1 03-14-2005 06:24 PM
convert text file to binary excel file ust Linux - General 2 11-23-2004 02:33 AM
File Searching JC404 Linux - Newbie 2 08-02-2003 08:45 PM
searching through a file albean Linux - Newbie 8 11-23-2002 08:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06: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