Shell script to get the OS version [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to write a shell script that will show me the OS version. I am using Linux Ubuntu 14.
How can i write a shell script that will show me the OS version?

Simply use lsb_release:
$ lsb_release -sr
12.04
See the man page for all available options. Note that not all platforms or Linux distributions have lsb_release.

Parse the output of uname:
#!/bin/bash
uname -s
and Bob's your uncle. Let me know if this helps.

Related

Why does the default shell in OS X 10 look differently than that in Linux (Mint, Lubuntu...)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
To clarify, when entering the default shell in OS X it appears as:
pcname:~ username$
and changing directories appears as:
pcname:myFolder~ username$
however, in my experience with linux distros, the shell appears as:
username#pcname:~$
what is the purpose for the differences in syntax?
What I do is the following: On the system that has the promt the way I want it, I type:
echo $PS1
I copy the result, say, \u#\h \w\a \$ and then edit the ~/.bashrc on the system that I want to use with the line:
export PS1="\u#\h \w\a \$ "
And then I get the same prompt on that system as well.
If you want to get creative, have a look here

What similar command to "xload" in linux will be for os x? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
In linux (I am using Ubuntu 15.04) there is a small program supplied with the X Window system called xload which displays a graph representing system load. I can excute this program by typing in command line the following: xload. I tried xload in command line on mac. But it said "command not found" My question is "What command, which is similar to xload in linux, should I use in command line for Mac OS X (El Capitan)"?
I'm not sure whether you want a windowed app or not. Assuming yes, then try
open -a "Activity Monitor"

Equivalent Mac "cp -X" on Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I'm migrating some bash scripts written for Mac to Linux, in which cp -X is used in several places. Some research shows that cp -X on Mac is different from cp -x on Linux.
The first one means "Do not copy Extended Attributes (EAs) or resource forks" while the latter means "stay on this file system".
So is there an equivalent Mac "cp -X" on Linux?
Thanks in advance:)
cp on Linux doesn't copy xattrs by default, and Linux doesn't have resource forks at all.
Thus, you don't need it -- default behavior does what you want.
However, if you want to be completely explicit:
cp --no-preserve=xattr

Standard contents of /etc/environment file in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm running Linux Mint 14 and accidentally replaced the contents of /etc/environment file. It was originally something like:
PATH=/usr/bin
but with some extra stuff. At the moment, most commands don't work in the terminal. If I do "ls", I get "command not found". Does anyone know the standard contents of this file is?
On ubuntu 12.04 it is:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

Installed an RPM file. Where to find the installed program? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about programming within the scope defined in the help center.
Improve this question
I have installed xmedcon-0.11.0-1.i686.rpm on my Fedora Linux machine. I ran the RPM file. Since I'm kind of new to Linux, I want to ask, where can I find the installed file and how can I run it?
Thanks.
From terminal use
$ rpm -ql xmedcon-0.11.0-1.i686 </code>
/etc/xmedconrc
/usr/bin/medcon
/usr/bin/xmedcon
You will see all the files installed. The main files will be above. From command line
run
$ /usr/bin/xmedcon
In case you already know the command name, you can type which medcon in a terminal and it should tell you where the executable is located.
And as full.stack.xchg said, just typing the name of the executable on a command line (or finding it in the graphical menu) will start the program.

Resources