i am trying to understand the concept of the output of ls command, specifically "number of links" for a directory and got utterly confused:
1) when i made first directory in my home directory:
dave@host:~:$ mkdir dir_l1
from the perspective of home directory, the link number for dir_l1show as 2, why 2?
2) then i created second directory inside of the first directory:
from the perspective of home directory, the link number for dir_l1 shows 3, why 3?
from inside of directory dir_l1, the link number for "." is 3, which is the same as its parent directory dir_l1 but ".." also shows 3, why? where did that "total 12" come from?
from the perspective of directory dir_l2, the "." has 2 but ".." has 3, why? where did that 8 coem from?
3) then i created third directory
from the perspective of home directory, the link number for dir_l1 still is 3, why?
from inside of directory dir_l1,
from inside of directory dir_l2:
Last edited by Corona688; 04-04-2014 at 05:59 PM..
Every dir has . and .., so there and somwhere the link counts go up. With no children, 2, parent entry and . in myself, and then with every child, 1 more for their .. entry.
I want to check my data quality. I want to output the lines with non-number. I used the grep command:
grep '' myfile.csv
Since my file is csv file, I don't want to output the lines with comma. And I also don't want to output "." or space. But I still get the lines like the following:... (8 Replies)
I want count number of characters / find the length of the 'wc -l' output
This is the command
bash-3.2$ gzcat /home/sid/file1.dat |wc -l
830752
So final out I want is 6 i.e lenght of 830752
I tried with awk
bash-3.2$ gzcat /home/sid/file1.dat |wc -l | awk '{print length ($0)... (3 Replies)
I am trying to output two command substitutions echo "$(command) $(command)" with a single echo however when using wc -l within the second substitution, that substitution, instead of appearing in order at the end of the line output, it overwrites the beginning of the output line.
I've tried... (2 Replies)
Hi,
I have a problem when doing calculations in awk.
I want to add up a few numbers and output the result.
testfile:
48844322.87
7500.00
10577415.87
3601951.41
586877.64
1947813.89
$ awk '{x=x+$1};END{print x}' testfile
6.55659e+07The problem is the number format. It should show... (3 Replies)
Hi All,
I tried searching a lot about this but to no avail. I have a HTML file. I used
links -dump file_page.html > text_html.txt
What the above command gave me was a filtered text from the HTML file with tags removed. Now, the the output from the above command looked something like this:... (1 Reply)
hello. i want to make an awk script to search an html file and output all the links (e.g .html, .htm, .jpg, .doc, .pdf, etc..) inside it. also, i want the links that will be output to be split into 3 groups (separated by an empty line), the first group with links to other webpages (.html .htm etc),... (8 Replies)