LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-23-2017, 12:32 AM   #1
ppankaj
LQ Newbie
 
Registered: May 2017
Posts: 5

Rep: Reputation: Disabled
Question How to store command output with command, date, time and user wise?


Hi,
I want to store command and command output, date & time, user and terminal in history. Is it possible via shell scripting? Please guide me.

Pankaj Srivastava
 
Old 05-23-2017, 12:57 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,006

Rep: Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891
try to google first:
https://chrisjean.com/command-line-h...untu-terminal/
https://askubuntu.com/questions/3910...n-bash-history
 
Old 05-23-2017, 02:21 AM   #3
ppankaj
LQ Newbie
 
Registered: May 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Wink

Hi,
I go through both the link and found history command short cuts and how to see when command is executed, but I want to store command output also in a separate file.
Please guide me.

T/R
Pankaj srivastava
 
Old 05-23-2017, 02:29 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,718
Blog Entries: 4

Rep: Reputation: 3959Reputation: 3959Reputation: 3959Reputation: 3959Reputation: 3959Reputation: 3959Reputation: 3959Reputation: 3959Reputation: 3959Reputation: 3959Reputation: 3959
The history file only shows what the person entered, not the responses from the computer. If you want a transcript of both input and output then you'll probably want to look at the script utility and launch it at the beginning of your session.
 
Old 05-23-2017, 02:31 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,006

Rep: Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891Reputation: 7891
try: https://is.gd/IBgDWS
 
  


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
store command output in html table format hruday Linux - Software 8 01-27-2017 05:57 AM
[SOLVED] Append output of a command in column wise manner shivaa Linux - Newbie 5 02-18-2013 02:43 AM
[SOLVED] How to store output of command to an array kasparov29 Linux - General 4 11-14-2011 02:26 PM
[SOLVED] How to store the output of command with pipes diwaker1984 Programming 3 01-20-2011 11:54 PM
How can I receive command output and store it to a variable athlonshi Programming 5 04-04-2010 08:09 AM

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

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