Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I do a lot of work in the terminal. Sometimes, after a week or two, start up gets a bit slow (I'm talking about an extra second or two, not the end of the world but it's slower).

I did some Googling that suggested clearing the logs in /private/var/log/asl/*.asl ought to speed things up, and it did.

Is it a problem if I added a little command that just cleared those logs when I exited terminal?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

If you want to control the amount of data that zsh stores in its history files the look at the zsh user guide section 2.5.4 and set HISTSIZE and SAVEHIST

As for the .asl logs they are written to be any application, they are the database of Apple's logging mechanism. zsh will not read or even know of these files unless you run command to look at them. Thus I do not see how their size would affect zsh's startup time.

However doing some googling (it helps to show in the question what you have found) It appears that there might be an issue with the login command (which is not zsh but used by the mechanism to start shells). See this thread for some comments - starting from your idea of deleting all .asl files to what seems a more reasonable explanation. login without the -q flag seems to do an ASL query for last login and that causes a slowdown. The suggestion given there and elsewhere is

The correct way to bypass the ASL query is to set Terminal to open shells with /bin/bash (or your shell of choice) instead of the default login shell. Terminal will still use /usr/bin/login to launch the shell, but it passes the -q switch to prevent the ASL query.

Note that deleting the .asl files removes all information logged by applications and so doing this removes all chance of seeing what happened on your machine. I think that losing this data is not worth saving a few seconds on startup of terminal, just leave terminal open or try the fix suggested.

share|improve this answer
    
Lovely, thanks, I'll set the -q flag for zsh log in. –  Ahmed Nuaman Jan 1 '13 at 11:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.