Comments on: 15 Interview Questions on Linux “ls” Command – Part 1 https://www.tecmint.com/ls-command-interview-questions/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 30 Sep 2021 00:02:01 +0000 hourly 1 By: Manuel Jordan https://www.tecmint.com/ls-command-interview-questions/comment-page-1/#comment-1598564 Thu, 30 Sep 2021 00:02:01 +0000 http://www.tecmint.com/?p=9013#comment-1598564 Thanks for this tutorial

About `ls -d`, when is mandatory or useful? it only returns "." at a first glance has no sense, could you update the answer to question #14? Thanks in advance

]]>
By: Phil https://www.tecmint.com/ls-command-interview-questions/comment-page-1/#comment-1311994 Wed, 15 Jan 2020 15:39:46 +0000 http://www.tecmint.com/?p=9013#comment-1311994 Excuse me? What is the point of these interview questions, please? What position would I be hiring for and ask myself – “has this candidate memorized all possible options of the ls command?”. These are great questions for the geek pub quiz but not job interviews…

]]>
By: Rohit Dhyani https://www.tecmint.com/ls-command-interview-questions/comment-page-1/#comment-1146069 Sun, 05 May 2019 19:09:55 +0000 http://www.tecmint.com/?p=9013#comment-1146069 Under Linux what simple thing can I do to make a file not appear in a standard ls directory listing

]]>
By: naresh https://www.tecmint.com/ls-command-interview-questions/comment-page-1/#comment-1100299 Sun, 10 Feb 2019 18:33:12 +0000 http://www.tecmint.com/?p=9013#comment-1100299 Super awesome interview questions and answers on Linux Commands.

]]>
By: Joseph in Atlanta https://www.tecmint.com/ls-command-interview-questions/comment-page-1/#comment-819474 Tue, 20 Sep 2016 05:28:02 +0000 http://www.tecmint.com/?p=9013#comment-819474 In-correct bit of information: on Question #5, the 2nd bullet point says that “Number ‘5‘ represents Symbolic Link.”

(a) The numeric field(2) between permission & file owner is the LINK_COUNT, but only includes direct/hard links.

(b) Symbolic links do NOT change/increment the link count for a regular file or directory.

(c) Unix/Linux allows the same exact file to have multiple names.

  1. These are not copies of file, but exact same file can be called red and blue at the same time,
  2. and both names will be listed in directory ‘ls’ listing… the names can be in different DIRs also.

(d) Link_Count shows count for “How Many simultaneous hard-link Names does this File HAVE?”

  1. You can also have “Symbolic or ‘soft’ links; but those are re-direction pointers and not counted the same.”

(e) Rule: You are NOT allowed to add hard-links (extra names) for a Directory… just normal files and programs.

(f) For a DIR, both the “dir-name” in parent dir, and the “.” dot-name in child dir are part of Link_Count,

  1. so Dirs have Link-Count 2 when created… All “normal files” have a Link_Count of 1 when created.

(e) Link count on Dirs goes UP as sub-dirs are created, since “..” entry in sub-dirs is a link pointing to parent dir.

(f) So… if you see a DIR with Link_Count above 2, you can subtract 2, and know number of child sub-dirs

(g) Thus, in Question#2 above, the Link_Count=5 means that dir “Binary” contains three sub-dirs.

  1. but the Link_Count does not tell you if there are Symbolic_Links, as noted in the example answer.
]]>