1

My ~/.profile contains a command which outputs to stdout when Ubuntu 16.04 with LXDE is started.

I grep /var/log/ for the output, but found nothing. Where would the output have gone, or is it lost forever?
Thanks.

See also https://unix.stackexchange.com/q/435189/674

2 Answers 2

3

Depending on the login manager you use, ~/.profile is not even executed when you login graphically, see https://superuser.com/questions/752493/profile-in-lxde#847051.

Also, in case it is executed (more technically correct "sourced"), the output to standard output will most likely be discarded.

If you want to write a log message, you could use the logger command (http://manpages.ubuntu.com/manpages/artful/man1/logger.1.html) to write to the system log, simply by piping your output into the logger command like this:

myCommand | logger
2

~/.profile is a user specific script file (contrary to the scripts in the unix question you quoted). If you want to capture its output you have to redirect stdout and/or stderr to a file.

In /var/log you can see traces of events that are system relevant or concern all users.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .