8. touch - Not working when I try on my personal laptop


#1



https://www.codecademy.com/en/courses/learn-the-command-line/lessons/navigation/exercises/touch?action=lesson_resume&link_content_target=interstitial_lesson


I have went through this exercise, then I tried on my personal laptop. However, when I typed in the commend "touch file.txt", it says 'touch' is not recognized as an internal or external commend, operable program or batch file.

I would like to know why? Is this because I am using Windows not Mac?

Then I searched on the forum and I found out that I can use "echo.>file.txt", and it works.

Can someone explain to me? Thanks!



This is the screenshot on my laptop......


#2

You could install a program named touch and make sure it's in your PATH, that's not really any different.
On this machine (fedora 24), touch is located at /usr/bin/touch, that is what gets executed when I type touch in a terminal.

The machines that you interact with in the course run gnu/linux, the course teaches bash and some other utilities commonly found on unix-like machines, and yes, mac a unix-like system, and windows is not

What you'd do to get a similar environment is to install a virtual machine with just about any linux distro (they use largely the same things, with different philosophies about what to include and how fast to change to newer software)

The creators of the utilities you're using in the course have some opinions on mac:
https://www.gnu.org/proprietary/malware-apple.en.html
So while most of the course applies to mac.. they are still very different


#3

So this mean that Codecademy is teaching about a language that mostly Mac or Linex can be used, but not Windows? I am a bit confuse....


#4

Cygwin is a distribution that contains ports of common gnu utilities to windows, so it's not that you can't use it.

The majority of server software runs on gnu/linux. A large problem with windows and mac is that they come with licenses that restrict your freedom. Their code is secret and doesn't necessarily serve you, it serves large companies, you come second.

What do you prefer, an os developed in secrecy designed to sell, or one where everyone's free to inspect and suggest changes, and the goal is to create useful tools?

A lot of people are willing to compromise just because everyone else does. Shiny things sell. And windows/mac are markets.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.