LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-17-2005, 08:32 PM   #1
carlosos
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Rep: Reputation: 0
Find linux version using console?


This might be a very dumb question but how do you know what linux version and disto someone has by just having console access. (ssh)
For example to know if it is debian 3.0 or 3.1.

I never was in the situation before that I didn't know because I always installed it myself.
 
Old 08-17-2005, 08:40 PM   #2
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Honolulu, HI
Distribution: Arch
Posts: 1,380

Rep: Reputation: 47
uname is used to print information on the system such as OS type, kernel version etc.

Some uname options:
-a --- print all the available information
-m --- print only information related to the machine itself.
-n --- print only the machine hostname.
-r --- print the release number of the current kernel.
-s --- print the operating system name
-p --- print the processor type.


Command syntax:

uname -options
 
Old 08-17-2005, 08:43 PM   #3
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
cat /etc/debian-version

should show the version of Debian running on the system.
 
Old 08-17-2005, 08:46 PM   #4
Diablo3d
LQ Newbie
 
Registered: Aug 2005
Posts: 10

Rep: Reputation: 0
Good question... I don't know if there is a standardized way to do this...

you could grep /var/log/messages or /var/log/dmesg for known distribution names. I grepped them for suse on one of my machines and was able to figure out my distribution and version number, but I think each distro will be a little different (assuming you can't reboot and watch the console)
 
Old 08-17-2005, 08:48 PM   #5
carlosos
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for answering. Using google I would say that I have Debian 3.1 (Sarge). Am I right with my assumption?

Quote:
DAV001:/opt/lampp# uname -r
2.6.8-2-386
DAV001:/opt/lampp# uname -a
Linux DAV001 2.6.8-2-386 #1 Thu May 19 17:40:50 JST 2005 i686 GNU/Linux
DAV001:/opt/lampp# uname -s
Linux
DAV001:/opt/lampp# uname -m
i686
 
Old 08-17-2005, 08:49 PM   #6
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
As I said, "cat /etc/debian-version" and "cat /etc/slackware-version" should show the version you are using if you run one of those distros. I'm not sure which others have those files though.
 
Old 08-17-2005, 08:50 PM   #7
carlosos
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks jrdioko.
It's 3.1
and
/etc/debian_version is the file called
(I not even have cat installed...)
 
Old 08-17-2005, 08:54 PM   #8
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Ah, sorry for the wrong filename. As I understand it cat is a pretty basic command that should be on every system, what do you get if you type "cat /etc/debian_version"?
 
Old 08-17-2005, 09:07 PM   #9
carlosos
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I can't tell you right now because I run a script that will take some time to finish. But it was something like command not found. I had to use the less command to look into the file and
Quote:
3.1
is in the file.
 
Old 08-17-2005, 09:09 PM   #10
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
When you can try "ls -l /bin/cat" and "ls -l "/usr/bin/cat"
 
Old 08-17-2005, 10:20 PM   #11
carlosos
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I think with a script that I just ran (to install vhcs and its prerequirements) installed cat because now it works. But anyways here is what happens now when I type the two things:

Quote:
DAV001:~# ls -l /bin/cat
-rwxr-xr-x 1 root root 16504 2004-07-16 13:37 /bin/cat
DAV001:~# ls -l "/usr/bin/cat
>
 
Old 08-17-2005, 10:28 PM   #12
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Oops, didn't mean to put that " in the second one, but the first shows that you do have cat. Either way, glad you found the version.
 
  


Reply


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
How to find Linux kernel & gcc version taichiman Linux - Hardware 4 04-12-2016 10:20 PM
How to find version of linux safun75 Linux - Newbie 20 01-09-2012 09:43 PM
How do I find the version of linux I am running? aaronruss Linux - Newbie 4 06-15-2009 11:27 AM
Find out distribution + version (NOT: kernel version!) Tajci Red Hat 5 06-08-2005 04:17 PM
what version of Linux and where to find rpm rkonda99 Linux - Newbie 11 06-14-2003 08:47 PM


All times are GMT -5. The time now is 07:08 AM.

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