I always wonder this, every time someone gives me access to their server, I always want to find out what distro it is. I figured it'd be more fun to actually type a command rather than asking the admin.
I always wonder this, every time someone gives me access to their server, I always want to find out what distro it is. I figured it'd be more fun to actually type a command rather than asking the admin.
On most modern distributions, you can query the Linux Standard Base system with
Sample output:
I answered a similar question on SuperUser.
For distribution name...
For platform...
The most reliable for figuring out which linux distribution:
Then cat whatever files look interesting from that.
But you probably (as mentioned in another comment already) always want to run
uname -a
first, in case it isn't even a linux distribution.There is a routine in VBoxSysInfo.sh, that is part of VirtualBox that can be a good starting point.
However, I'd rather ask the sysadmin about this. Apart from the distribution, particular servers can have specific settings and it is frustrating to discover those right after breaking them (not to mention pissing off the sysadmin, that'll became hostile to you for being a smartass and breaking his server). I tend to treat all sysadmins as friends/teammates, there is plenty of other people to fight with: users, management etc :-)
You can also run
nmap -A
to let it guess the OS and version installed on a remote host