I am using debian. Is there a command that will show me what user I am currently logged in as?
I want to use this command in a rails application that I'm building for debugging purposes.
I am using debian. Is there a command that will show me what user I am currently logged in as?
I want to use this command in a rails application that I'm building for debugging purposes.
In ruby/rails you can use
require 'etc'
Etc.getlogin
which returns the username of the current user (works on any platform!)