Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-15-2006, 12:55 PM   #1
Registered: Feb 2006
Distribution: Slackware 10.2, (, FC 5
Posts: 109

Rep: Reputation: 15
Is there a way to determine distribution from the command line?

I know that many distros give the name of the distro at the login prompt in one of the command line shells, but I've seen a few that don't list the distribution name. If I'm at a machine that doesn't have a gui installed and if the CL shell doesn't display the distribution info at login, is there a command that can be used that will display this info?
Old 02-15-2006, 12:59 PM   #2
Registered: Sep 2003
Location: UK
Distribution: I use 'em all ;-)
Posts: 275

Rep: Reputation: 38
In some distro's you can do:

cat /etc/release
Old 02-15-2006, 01:14 PM   #3
Registered: May 2004
Location: Tampa, Fl
Distribution: Arch
Posts: 648

Rep: Reputation: 30
sometimes a uname -r will give you what kernel version this distro is using. (it might be some other modifier), Sometimes this will tell you as well.
Old 02-16-2006, 07:54 AM   #4
Registered: Feb 2006
Distribution: Slackware 10.2, (, FC 5
Posts: 109

Original Poster
Rep: Reputation: 15
Thanks for the responses. Unfortunately the first did not work on either of the systems I tried it on as the file /etc/release does not exist.

The second gave me kernel and hardware info, but no distro info.
Old 02-16-2006, 08:34 AM   #5
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
In Ubuntu, I just did this:

find /usr | grep ubuntu
This gave a whole bunch of ubuntu doc files--pretty good clue.

don't know how universal this approach will be

For completeness, you would use:
find / | grep name, where "name" is the distro of interest
Old 02-16-2006, 08:50 AM   #6
Registered: Sep 2004
Location: Dayton, Oh
Distribution: Linux Mint 17
Posts: 150

Rep: Reputation: 18
/etc/issue might be a good place to check as well, though you might find some sys admins edit that file so that things like their distro and hardware information isn't realeased to anyone that hits the server on an open port.
Old 02-16-2006, 08:59 AM   #7
Senior Member
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
cat /proc/version
Old 02-16-2006, 09:30 AM   #8
Registered: Sep 2005
Location: Warsaw, Poland
Distribution: Slackware 10.2, Caldera OpenLinux 3.1, Corel Linux (Thanks xhi!), Debian GNU/HURD etc...
Posts: 296
Blog Entries: 1

Rep: Reputation: 30
whatever happened to uname -a?
Old 02-16-2006, 09:33 AM   #9
LQ Newbie
Registered: Aug 2003
Location: NJ
Distribution: Fedora
Posts: 17

Rep: Reputation: 0
On Fedora and RedHat, the release file is /etc/redhat-release

So you can try:

cat /etc/redhat-release
Old 02-16-2006, 10:17 AM   #10
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
This should work everywhere, but I don't have yet all linux distros installed so no way to check

cat /etc/*version 2> /dev/null
cat /etc/*release 2> /dev/null
Old 02-20-2006, 08:15 PM   #11
Registered: Feb 2006
Distribution: Slackware 10.2, (, FC 5
Posts: 109

Original Poster
Rep: Reputation: 15
Thanks for all of the suggestions. I will give them a try.
Old 02-21-2006, 07:44 AM   #12
Registered: Feb 2006
Distribution: Slackware 10.2, (, FC 5
Posts: 109

Original Poster
Rep: Reputation: 15
cat /proc/version


cat /etc/issue

worked swimmingly for what I need. Thanks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
Command line distribution czechknight93 Linux - Distributions 7 02-17-2006 01:54 AM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM
51 characters only in the 1st Line of command line eggCover Linux - General 2 07-29-2004 01:28 PM
Can someone tell me a command to determine the hostname of an IP on the network? brow27 Linux - Newbie 4 05-20-2004 03:28 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration