GREP - What language is Linux / Unix utilities written in? [closed] - bash

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I was curious as to which language was utilities built into the Linux kernel was written in such as grep, cut, awk, find etc.
Are these compiled and can not be cat'ed and viewed?

The Linux kernel is written in C primarily. You can get it with:
git clone git://github.com/torvalds/linux.git
and then look at anything you please. Supporting commands, awk etc, can be found at GNU Software under 'All GNU Packages'.

The GNU tools can be found on the GNU project hosting page http://savannah.gnu.org/.
There you can review the source code of, for example, grep: http://git.savannah.gnu.org/cgit/grep.git.
Linux itself is not an operating system but the kernel. The tools you're mentioning form the so
called userland, which is separated from the kernel. Combining the GNU tools with the Linux kernel (and some glue) forms the GNU/Linux operating system.

Related

uname on Windows Terminal [closed]

Closed. This question is not about programming or software development. 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 months ago.
Improve this question
I was wondering if the command uname works in Windows terminal? If so what does it output? I read that it could be Windows or WindowsNT
I believe uname shows you your kernel. So on GNU/Linux, running uname gives you Linux because that is your kernel. Out of Windows or WindowsNT, I'd assume Windows would give you Windows NT because that's the kernel it uses.
$ whatis uname
uname (1) - print system information
uname (2) - get name and information about current kernel
I think you can get similar information by using systeminfo.
in Windows, uname-equivalent is the 'ver' command.
>ver
Microsoft Windows [Version 10.0.19044.1889]
you can create a tiny script, call it uname.cmd
>type uname.cmd
#ver
Then you have your own uname command on Windows
>uname
Microsoft Windows [Version 10.0.19044.1889]
I tested the above on my Windows 10 PC.

Can I use Bash on Ubuntu on Windows to practice 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 am a newbie to Linux. May I ask if I can practice Linux in Bash on Ubuntu on Windows? Sorry for asking such a stupid question. But please help!
Thanks!
If you are using windows 10, there is now a bash shell built in that can be easily set up. Check out this tutorial to do so.
If you are not on windows 10, I would recommend Cygwin (download) as an alternate program to run bash scripts
I think you will manage to get some familiarity with working with a linux console and some of the commands, however there is certain functionality which doesn't quite work.
What I would suggest though is dual booting Linux next to Windows, to immerse yourself properly and get a clear picture of things from the start.

Reason why a shell command behave differently depending on OS [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
Like sed, there are shell commands which don't behave in the same way in the same shell.
Behavior of them seems to be different depending on OS (*BSD or GNU/Linux) not on shell though they are shell commands. I wonder at this. Could anyone please explain why shell scripting doesn't behave the same way on multiple platforms?
Different systems evolved their own tools and syntax, to a certain degree. Linux uses the GNU toolchain, which supports a variety of modern options. However, there is one thing that Linux and BSD (and many other Operating Systems) have in common: POSIX.
This is the POSIX specification for sed. You can rely on these working on all *nix platforms. There is usually a way to do whatever you're trying to do in a way that works with all versions of sed.
You'll also find the same inconsistencies between awk and gawk.

Why is there no built-in grep in Windows? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
In e.g. the question Is there a Pattern Matching Utility like GREP in Windows?, one can find a few options for adding a grep utility to windows. But I am wondering why it's the case that there is no built-in grep-like function in Windows, as this seems to be a supremely useful thing (at least to a Linux user).
More specifically, is there a technical reason for this? E.g. does the difference in OS/filesystem architecture between Windows and Linux make it more difficult/slow/pointless/unsafe/etc. to have such functionality in Windows?
(I can imagine for example that an antivirus might not like for a program to read thousands of files in one go, and because of that microsoft perhaps decided to scrap a grep utility. That's of course pure speculation on my behalf, but it's the kind of answer I'm looking for)
"Grep" is an unix tool - it was originally made for unix.
As far as the functionality goes, we have built-in "grep". Windows offers something similiar through commands find and findstr, which do quite a lot, and have been available for long time.
Plus, you can search file content through windows search.

Windows shell/command prompt? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
On the Windows operating system, the shell/terminal we have by default is the Command Prompt (CMD).
Now, when I use Linux (or even Mac) systems, I find that the terminal is generally a lot more full featured. The one I used made it easy to change settings and properties, was easily resizable, some even had line numbering and multiple tabs.
Since I've started programming, I've realized the importance of the command line, and I was wondering if there were any alternatives to the default Command Prompt? And, if there aren't many good alternatives, how would I go about writing my own? What would I have to take into consideration?
Yes, the Windows command prompt sucks. It is truly pathetic for 2011.
I use Cygwin+mintty instead.
If you miss Tilda/Guake/Yakuake (for Linux) or TotalTerminal (née Visor) (for OS X) try mintty-quake-console.
Edit
Just came across another potential alternative, though I haven't tried it out yet: Gow (Gnu on Windows).
If you want a truly manly command line for Windows, use PowerShell.

Resources