LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Find linux version using console? (https://www.linuxquestions.org/questions/linux-newbie-8/find-linux-version-using-console-354369/)

carlosos 08-17-2005 07:32 PM

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.

bosewicht 08-17-2005 07:40 PM

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

jrdioko 08-17-2005 07:43 PM

cat /etc/debian-version

should show the version of Debian running on the system.

Diablo3d 08-17-2005 07:46 PM

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)

carlosos 08-17-2005 07:48 PM

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

jrdioko 08-17-2005 07:49 PM

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.

carlosos 08-17-2005 07:50 PM

Thanks jrdioko.
It's 3.1
and
/etc/debian_version is the file called
(I not even have cat installed...)

jrdioko 08-17-2005 07:54 PM

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"?

carlosos 08-17-2005 08:07 PM

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.

jrdioko 08-17-2005 08:09 PM

When you can try "ls -l /bin/cat" and "ls -l "/usr/bin/cat"

carlosos 08-17-2005 09:20 PM

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
>


jrdioko 08-17-2005 09:28 PM

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.


All times are GMT -5. The time now is 03:56 AM.