Number of hard links


#1

here hardlinks in the directory drama is given 6, but I think it will be 4, drama itself, parent directory movies and child directories biopoc and historical. If we consider the child files of the child directories too then the hard links of comedy should be 6 too instead of 4. What's wrong in here?

I'm doing lesson 2 (3/10) in command sections.


#2

If you're refering to the example then we don't know what's in that directory. Try it on a directory that you can inspect (and keep in mind that there could be hidden files, so use ls -la)


#3

No, it is okay now. That was another example. When I typed into terminal actual results came. But it did not include child files just child directories. But in the example it is said that child files and directories number are also added.

And another further more question, in my own computer where can I get that terminal? I tried the command prompt but no help. And the "$" sign given on the top of the terminal- is it a must? Should we type it when we try it on our pc?

Thanks for helping me anyways :slightly_smiling:


#4

This course is for Linux/Mac, not Windows. :slightly_smiling:


#5

Yes, it counts the number of links to itself. Each child directory, itself, and its parent has a hard link to it.

$ is just a prompt, telling you that the shell is ready to receive a command, it can look any way you want, some commonly included information in the prompt is current directory, username, hostname, date/time..

If you're on linux or mac which are both unix-like, then the terminal should be easily accessible, you've probably got some search feature for finding programs which should be able to find it.

Windows is different.. You can get bash for windows but I don't particularly recommend it. The shell is a way to control your computer and windows already has that all figured out with point-and-click stuff, while for linux the terminal is the main interface.. mac sort of does both I suppose. So what the shell is good at is automating tasks and typing what you want as opposed to finding a button that does what you want. There might not be such a button. So since its purpose is to control the OS, it makes sense to use an OS that's built with the terminal in mind. My suggestion is therefore to install virtualbox or some other hypervisor and then install some linux distro in a virtual machine. Doesn't really matter which distro they all use the same stuff for the most part, with the main differences being in how they are maintained (release cycles, how recent the software is) so roll dice between Fedora (more recent software) or Mint (more point and click, whatever that's supposed to help with)

Also note that the terminal in the command line course is hooked up to what is as really close to a full OS (ubuntu to be specific) so everything there are real tools and you can go right ahead and download, compile and install stuff that's missing in there, that obviously takes a bit of know-how, but all of this does.

Strictly speaking we can very much have GNU environments in Windows too. All it takes is a C compiler and then just install the rest from there. If you sat me down at a Windows computer and told me I had to use it, then I'd do that and just ignore the fact that it's a Windows machine. Makes more sense to simply use a unix-like system though.