Results 1 to 5 of 5

Thread: Terminal commands to identify environment

  1. #1
    Join Date
    Dec 2012
    Location
    Canada
    Beans
    187
    Distro
    Ubuntu 12.04 Precise Pangolin

    Terminal commands to identify environment

    I've been reading a lot of posts in this forum recently and have learned a great deal. However, while I've seen lots of terminal commands to display the OS and kernel versions, enumerate hardware, show networking status, etc., I haven't yet found ones that would reliably identify

    1. The active desktop environment.

    2. Whether the session is _not_ persistent, e.g., running from a Live CD or equivalent. (From my own mucking about I wonder if grepping /etc/fstab for 'aufs' could be used as a reliable indicator?)

    Thanks for any pointers!

  2. #2
    Join Date
    Nov 2012
    Beans
    Hidden!

    Re: Terminal commands to identify environment

    echo $DESKTOP_SESSION - identifies desktop environment.

  3. #3
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Terminal commands to identify environment

    Yes, grepping fstab would be a reliable way to do it. Although there are many, many live CD/DVD's you would have to compile a list of markers to uniquely identify each different type of live environment.

    When logged into my freenas file server I find the following:

    [tgalati4@freenas ~]$ cat /etc/fstab
    # Device Mountpoint FStype Options Dump Pass#
    /dev/ad1s1a / ufs rw 1 1
    proc /proc procfs rw 0 0
    # Used for htop if I can ever get it to work
    # linproc /compat/linux/proc linprocfs rw 0 0

    freenas runs the ufs file system and it is running from a hard disk, not a live usb or CD.

    But on my Jaunty laptop:


    tgalati4@tpad-Gloria7 ~ $ echo $DESKTOP_SESSION
    default

    Which is not very helpful in identifying that I am running a Gnome2 desktop.
    Last edited by tgalati4; December 15th, 2012 at 01:49 AM.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  4. #4
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Terminal commands to identify environment

    Quote Originally Posted by tgalati4 View Post
    Yes, grepping fstab would be a reliable way to do it. Although there are many, many live CD/DVD's you would have to compile a list of markers to uniquely identify each different type of live environment.

    When logged into my freenas file server I find the following:

    [tgalati4@freenas ~]$ cat /etc/fstab
    # Device Mountpoint FStype Options Dump Pass#
    /dev/ad1s1a / ufs rw 1 1
    proc /proc procfs rw 0 0
    # Used for htop if I can ever get it to work
    # linproc /compat/linux/proc linprocfs rw 0 0

    freenas runs the ufs file system and it is running from a hard disk, not a live usb or CD.

    But on my Jaunty laptop:


    tgalati4@tpad-Gloria7 ~ $ echo $DESKTOP_SESSION
    default

    Which is not very helpful in identifying that I am running a Gnome2 desktop.
    I would use
    Code:
    user@host~$ env
    Amongst other things it shows
    Code:
    GNOME_DESKTOP_SESSION_ID=Failsafe
    ...in my case
    -BAB1

  5. #5
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Terminal commands to identify environment

    tgalati4@tpad-Gloria7 ~/Desktop $ env | grep DESKTOP
    DESKTOP_SESSION=default
    GNOME_DESKTOP_SESSION_ID=this-is-deprecated

    No help here either.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •