FAQ: Manipulation - ls -l

This community-built FAQ covers the “ls -l” exercise from the lesson “Manipulation”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn the Command Line

FAQs on the exercise ls -l

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

I am failing to get the green check mark to continue to step 2. When asked to navigate to the comedy/ directory, I’m entering cd /home/ccuser/workspace/movies/comedy

I think this is correct, but not getting the green check mark.

2 Likes

the exercise won’t approve of using absolute path, you will have to use the relative path from the right working directory

1 Like

*** UPDATE *** I have since worked this out, I understand what stetim94 is referring too now they command required is simply ‘cd comedy’ as this moves from movies to comedy ‘relatively’ rather than completely changing file destination ( albeit that’s my understanding, hope this helps someone else )

I am having the same problem, i have tried several methods of cd,

i have tried also cd ./comedy
and when checking i am in the correct folder using pwd i am there but the task will not provide me with the green tick to move on

2 Likes

cd comedy actually just worked for me.

4 Likes

I’ve had the same problem. Wrote cd ./comedy/ and didn’t get the green tick. However, tried as you suggested cd comedy only, and the problem was solved. Thank you!

1 Like

I’m having an issue with the same thing. I tried all possible ways 10 times each and nothing works…

Hello CC Moderator,

Can you please explain what “Hard Links” number actually includes per reading in this Lesson?

Lesson says the following:

Number of hard links. This number counts the number of child directories and files. This number includes the parent directory link ( .. ) and current directory link ( . ).

However, if we follow what the actual filesystem tree contains, it will be different from what terminal produces: (this picture was presented in the beginning of the lesson -

  • per filesystem tree, while in movies directory:
  • action should contain total of 4 child items, which coincides with terminal: scifi, superhero, superman.txt, wonderwoman.txt;
  • comedy should contain 2 child items, slapstick, satire, but terminal says that is has 4;
  • similarly, drama should contain 2 child items, biopic, historical, but terminal says 4 again:
    45%20PM

I have found similar inconsistencies between numbers-logic when going into child directories and printing ls -l command.
Thank you for your time and clarification!

1 Like

Directories can never be hard links, and none of the other files you mentioned are hard links, they are just files

understanding what hard links are is quite useful:

https://medium.com/@wendymayorgasegura/what-is-the-difference-between-a-hard-link-and-a-symbolic-link-8c0493041b62

anyway, in action directory are two hard links: current directory (.) and parent directory (..), then scifi and superhero each also have a hard link to parent directory (..), this way, you have 4

2 Likes

Hey, everyone has probably figured this out by now, but I’m putting it here for any future forum visitors as well.

@lukecook3081430052, @pinboynyc, and @devasconcelos, and @saharab:

I was having the same problem, and thought I had a workaround that somebody else had “discovered”. But it was wrong. Fortunately, @midlindner had the right answer.

Yes, if you do this to get back to the right place, Codecademy will tell you that you got the first step wrong. All you have to do to fix that is then follow all the exercise instructions.

Also, you gotta make sure you’ve got both those fullstops in there before the slash. I noticed a couple of people not doing that. That might also cause a problem.

LMK if that helps!

I’ve checked some online resources saying that hard links can only be created on files, not on directories. Yet, in the content about ls -l, it says the number in the second column refers to the number of hard links to files and directories.

The two explanations seem in conflict, and I’d like to know if I have any misunderstanding.

Both are true, as user you can’t create hard links for directories. However, the exception is current directory (.) and parent directory (..) which are created by the operating system. They are an exception to the rule so to speak

1 Like

Please describe what is “hard link”? Means we must have also “soft” ones or others? I could find the answer in the internet, but I prefer to have the description from codecademy, it’s better. Thank you for your efforts!

As usual codecademy does a piss poor job of explaining how to do something. “Navigate to the comedy/ directory.” How do I navigate? I’m taking a command line course because I don’t know how to navigate. If I knew how to navigate, then I wouldn’t be taking this course. How do I do this?

Thanks,

Ken

the course is divided in syllabuses, the first one being navigation:

https://www.codecademy.com/courses/learn-the-command-line/lessons/navigation/exercises/your-first-command?action=resume_content_item

which you can use to check if you forgot how to navigate, or consult documentation.

1 Like

Thanks for your reply. That was helpful.

The most useful for me was the phrase: “A directory contains an entry for itself, its parent, and each of its children.” And the word “itself”.

hello, this content hasn’t been explained yet:
" Number of hard links. This number counts the number of child directories and files. This number includes the parent directory link ( .. ) and current directory link ( . )."

what is hard links. and didn’t have defination for ‘…’ and ‘.’ .
Since the file Tree is not match with the lesson content so it’s hard to understand.

(Edit: there are Q&A previous, consider to put this on lessons plz, thanks)