Posted over 7 years ago. Visible to the public.

Get the initial username which you used to login to your Linux system

If you need the initial user which you used to login to your Linux system or the time when you login you can do:

Copy
whoami

One purpose of this could be the .bashrc to show different Bash Prompts for root to different users:

Copy
if [ $(whoami) = "root" ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[41;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Avatar
Kim Jahn
Last edit:
5 months ago
by Stefan Langenmaier
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Kim Jahn to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more