LinuxQuestions.org
Review your favorite Linux distribution.
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 12-10-2016, 03:21 AM   #1
jet36
LQ Newbie
 
Registered: Nov 2016
Posts: 8

Rep: Reputation: Disabled
Tracking the Output of an executable.


Hey I have a file that is executable only and I need a way to find out where the output of the file is going when I execute it. I have tried looking for newly made files but none seem to match the time when I ran the file. Are they any tools to help me with this?
 
Old 12-10-2016, 04:35 AM   #2
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Hi,

You can use the strace command. It tracks system calls and signals involving the process.

Code:
strace COMMAND   (will print results on stdout: command line)
strace -o LOGFILE COMMAND    (will print results in the text file LOGFILE)
e.g
Code:
strace -o strace_ls.log  ls -l
So, for the executable you will do this, assuming you are in the directory where the executable is found:
Code:
strace -o YOURLOGFILE ./EXECUTABLE

Last edited by aragorn2101; 12-10-2016 at 04:40 AM.
 
Old 12-10-2016, 04:52 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,627

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Yes, there are tools, but that is about all I can say with the information you have given us.

Have you checked your homedir? What program is it?
 
Old 12-10-2016, 05:28 AM   #4
jet36
LQ Newbie
 
Registered: Nov 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by aragorn2101 View Post
Hi,

You can use the strace command. It tracks system calls and signals involving the process.

Code:
strace COMMAND   (will print results on stdout: command line)
strace -o LOGFILE COMMAND    (will print results in the text file LOGFILE)
e.g
Code:
strace -o strace_ls.log  ls -l
So, for the executable you will do this, assuming you are in the directory where the executable is found:
Code:
strace -o YOURLOGFILE ./EXECUTABLE
This is wonderful and helpful, exactly what I was looking for. Thank you!
 
Old 12-10-2016, 07:52 AM   #5
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
You can find more info on strace here:

8 Options to Trace/Debug Programs using Linux strace Command
 
  


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
[SOLVED] which command replaces executable with output HeidiJTP Linux - Newbie 6 03-26-2013 11:39 AM
My output file from gfortran compiler is not executable Zope Programming 1 03-08-2013 08:03 AM
[SOLVED] directing output from an executable program into a specific folder emaritza Linux - Newbie 14 07-19-2012 12:39 PM
executable to run a command every n seconds and display output benq70 Linux - Newbie 1 05-01-2008 06:39 PM
Build scripts say my C compiler cannot make executable output noware Linux - Software 2 06-07-2006 02:15 PM

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

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