Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-23-2011, 08:11 PM   #1
Registered: Mar 2006
Location: Bellevue, WA USA
Distribution: Debian KDE/Fluxbox
Posts: 36

Rep: Reputation: 15
Remove time stamps from text file

Hey Guys,

I just recently restored a system that had gone down to another server and we're checking that all the content has been moved over (we've gotten some reports of issues).

I've generated a a hefty list of all the files with a CRC checksum to compare against, however I've run in to a problem where the list contains the mtime of each file, and it's different on the destination so it's throwing off the diffs I'm running and I'm getting a lot of false positives.

I'm curious if anyone can tell me how to pull a timestamp out, rather just the first two columns out (however there are lines that start with a #) here's a sample of what I'm working with:

#  Archive data\10\
2008-04-08 15:44         22769          2675  69ce6018  imsmd_rootv1p2p1.xsd
2009-04-19 23:10          1511           551  591f3a83  index_lms.html
2009-04-19 23:10         10255          3407  c23eed6f  player.html
Old 08-23-2011, 10:16 PM   #2
Registered: Aug 2010
Location: Denmark
Distribution: Debian
Posts: 96

Rep: Reputation: 0
This maybe ?
Will give you the last to colums only.

<input> |awk '{print $5,$6}'

Maybe this is what you want, which skips lines starting with #.
<input> |awk '{if($1 !="#"){print $5,$6}}'

Last edited by LBM; 08-23-2011 at 10:44 PM.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
file time stamps missing detail evilalmus Linux - General 2 12-28-2010 01:11 PM
Remove lines in a text file based on another text file asiandude Programming 10 01-29-2009 11:59 AM
LXer: Using Perl On Linux To Do Mass Synchronization Of File Time Stamps LXer Syndicated Linux News 0 05-27-2008 08:41 AM
Time stamps following move to British Summer Time aikempshall Linux - General 2 03-30-2007 09:30 AM
Time Stamps Duplication indiancosmonaut Solaris / OpenSolaris 4 02-28-2007 11:30 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:46 AM.

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