LinuxQuestions.org
Visit Jeremy's Blog.
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 09-30-2010, 08:28 PM   #1
vbekker
Member
 
Registered: Aug 2010
Location: Brooklyn, NY
Distribution: CentOS
Posts: 38

Rep: Reputation: 0
How do i process the output of a locate command, pipe it to what?


Hi,
Is there a way to process the output of a locate command on the spot within bash. The output is 3 lines, ex:

Code:
[root@server confluence]# locate .timestamp
/opt/confluence/confluence-persistent/index/.timestamp
/opt/confluence-2.7.3-std/confluence/index/.timestamp
/opt/confluence-3.0.2-std/confluence/index/.timestamp
[root@corp-app-server confluence-persistent]#
Let's say i wanted to show the modifications dates on these file right in the terminal...is there a way?

This does not seem to work
Code:
locate .timestamp | ls -l
I appreciate any help. Thank You
 
Old 09-30-2010, 08:43 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,550

Rep: Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898
How about:
Code:
ls -l $(locate .timestamp)
 
Old 09-30-2010, 08:46 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852
Try this:
Code:
locate .timestamp | xargs ls -l
man xargs will give you further information.
 
  


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
How to pipe output to another command parameter? FireRaven Linux - Newbie 2 07-20-2009 08:44 AM
how to pass pipe output to file command nickleus Linux - General 6 06-19-2008 07:18 AM
How can I pipe output of a command into arguments of a script HGeneAnthony Linux - General 3 12-26-2007 07:24 AM
Pipe output of command to php !!! ALInux Programming 7 12-30-2006 01:36 PM
how to pipe and parse output of a command learnfast Linux - Newbie 2 06-15-2005 05:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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