New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

Automatically save log files of terminal sessions


Post Reply New Thread Subscribe

 
Thread Tools
Stubaan

 
Member Since: Jun 10, 2011
Posts: 1
Stubaan is on a distinguished road

Stubaan is offline
Hi folks

Does anyone know whether there is a setting in Terminal that will automatically generate log files of all Terminal sessions and save them individually? I saw an allusion to this on a post somewhere but cannot find any such setting myself.

That failing, can anyone give me a hand implementing this solution I found on a dead forum? I am an extreme novice when it comes to this.

Quote:
Use the script command. I've set up one of the macs here to log everything automatically every time the terminal is opened. Just save these two lines into a blank file:

#!/bin/bash
script "/Users/<yourname>/Documents/Logs/`date "+%m.%d.%y %H.%M.%S"`"

Then make it executable, put it somewhere like /usr/local/bin and set it as the command to execute when creating a new terminal window in Terminal preferences.
Specifically;
1) I have saved a text file with this content on my desktop but when I try to copy it to /usr/local/bin via Terminal (because I can't actually navigate there manually with Finder) I get a permissions denied error...
2) How would I then make it executable?
3) How would I set is as the command to execute when creating a new terminal window in Terminal preferences - I cannot see where/how to set this.

MUCH 'bliged.
QUOTE Thanks
JoanaValente

 
Member Since: Mar 01, 2013
Posts: 2
JoanaValente is on a distinguished road

JoanaValente is offline
Hi, I'm having the same doubt about this issue.
I'm running a program in terminal and want to same all the log.

Can anyone answer?

ps- i'm a newbie
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 2,607
cradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud of
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
You need to put the second line in .bashrc or .bash_profile. These may or may not be in your home folder.
If you don't have one, copy /etc/bashrc and/or /etc/profile to your user folder. Notice the periods in the first line. This makes the files hidden.
Edit the file, then rename it with the period. Be sure the files are in plain text, not .rtf.
If you need detailed instructions i can give it when I get off work at noon.

Craig Domingue - resident redneck.
QUOTE Thanks
JoanaValente

 
Member Since: Mar 01, 2013
Posts: 2
JoanaValente is on a distinguished road

JoanaValente is offline
thank you. i'll try that
QUOTE Thanks

Post Reply New Thread Subscribe


« iPhoto / Facebook problems | PDF copy and paste malfunction in Preview »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
deleting log files alphonso49uk OS X - Operating System 1 01-22-2011 05:30 PM
How to Transfer/Backup iPod files (Windows/Mac) fguiytr66 Images, Graphic Design, and Digital Photography 0 10-30-2010 10:31 PM
Terminal to join VOB files? leelovesbikesto OS X - Operating System 4 02-04-2006 04:08 PM
Combine AVI files in OS X Terminal jacobonline Movies and Video 1 04-16-2005 05:14 PM
Can OS X save files to W2K3 Server 2003? imagi_n8 OS X - Operating System 0 04-06-2005 07:11 PM

All times are GMT -4. The time now is 04:56 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?