what are the fields of the 'ls -l' call under bash [closed] - bash

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
What are the fields in listed order when one makes the call: ls -l in a bash shell. First I know is file type and permissions, next are a series of 4 integers that I do not know or am uncertain about, then is a date permissions were assigned then another integer and a time, then finally the file name. What I really want to know is what are the 4 integers between file permissions and permission assignment dates? The assignment dates follow a format of, ie "Oct 2 03:15"?

Considering the four integers you mention:
Hard Link Count. See this site.
Group of the user that
owns the file. Shouldn't be a number. If you get a number on your
system this would be a non-standard.
User that owns the file. Again, shouldn't be a number.
File size

Related

How can the machine generate random numbers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
The Computer is designed to execute certain tasks exactly.
It is not able to make arbitrary tasks : So how can It generate random numbers?
Yes, you are right. Computers cannot generate Purely Random numbers. Therefore, they are called Pseudo Random. Most common technique used, today, to generate a random number is by reading the machine time in milliseconds and perform arithmetic operations on it to get a new number every time. You can read more about it here

bash sort numerically correct [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I'm having a problem with sorting that -V isn't solving. I have a very well structured set of folder names (shown below with sort -V) that I want to do a version sort but recognizing floating point numbers (see the first two entries). Any advice?
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_3_um_V_97.4_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_3_um_V_97_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_6_um_V_90_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_6_um_V_153_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_7_um_V_70_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_8_um_V_70_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_8_um_V_80_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_9_um_V_192_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_10_um_V_90_V
You can apply numeric sort for 15th field if you want to sort by floating point number.
$ cat test.txt | sort -t _ -V -k 1,14 -k 15n
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_3_um_V_97_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_3_um_V_97.4_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_6_um_V_90_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_6_um_V_153_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_7_um_V_70_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_8_um_V_70_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_8_um_V_80_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_9_um_V_192_V
Xe_phi_3.5_eV_tOn_0.5_ns_tOff_20_ns_d_10_um_V_90_V

Bash - removing characters other than specific string [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I use wget -O to get the site text to a specific file.
It saves the file within ONE line. File has about 2 milion characters. After, I would like to remove any other characters different from "directory= ************" format (including quotation mark, **** stand for any text till second quotation mark).
Is there any smart way to acomplish that?
grep -o '"directory= [^"]*"' file
The smartest way would be to pipe it out to a smarter interpreter. Python for instance.
Python has a great regular expressions library at your disposal.

Why do bash's man pages have double letters when written to file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I've been wondering about this for a while. Whenever I run a command of the form "man [command] >> file.txt", there's a weird phenomenon where words that were bold when I viewed the man page in Terminal appear in the text file with each letter repeated twice.
For example,
DESCRIPTION
The find utility recursively descends the directory tree for each path listed
turns into
DDEESSCCRRIIPPTTIIOONN
The ffiinndd utility recursively descends the directory tree for each path
listed
Why is this? I can't think of a file encoding for which this makes sense. (If it encoded "bold" as "write each letter twice", then the band Abba would show up as A b a, among other problems...)
Try man -7 or man --ascii [command] >> file.txt which will export man pages to ascii.

Generating first names based on race/ethnicity [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I want to generate some fake people for a piece of software I'm writing. These people also have ethnicities, and I'd prefer not to have names that don't look totally out of place when compared to those ethnicities.
My first idea was to base it on data. There is a table of first and last names from the 1990 US census with attached frequencies, but that says nothing about ethnicity. There is also a table of last names from the 2000 US census which is broken down by ethnicity, but it says nothing about first names.
So I need some way of generating first names based on ethnicity. Any ideas?
Use behindthename.com. They have very extensive lists of names by usage, including lists of popular names.
The site http://www.babynamefacts.com/ contains lists of most popular baby names per country. This may be a good starting point. For example, this page shows the most popular baby names for Serbia in 2009: http://www.babynamefacts.com/popularnames/countries.php?country=SRB .

Resources