高速に ls -l と wc -l の結果をマージした出力結果を得たい

Q

quickstar

やりたいこと​


ディレクトリ内の全てのファイルを対象に、ls -l の結果の一部と、wc -l の結果の一部をマージした結果を得たいと考えています。

具体的には次のような結果です。1列目にファイルの mtime の年月日、2列目にファイルパス、3列目に行数があるような結果です。

得たい結果​


Code:
2020-02-06 ./index.php 17
2023-01-01 ./license.txt 384
2023-07-06 ./readme.html 97
2023-05-13 ./wp-activate.php 218
2023-11-09 ./wp-admin/about.php 381
...

なお、上記はサンプルファイルとして wordpress.zip で試した結果です。

この結果は、次のような for 文を書けば得られるのですが、for 文を使っているためか1行ずつの処理になってしまい、ファイル数が多いと結果を得られるのが遅くなってしまっています。wordpress のファイル群で試すと手元で10秒ほどかかってしまっています。

Code:
IFS=$'\n'
for line in $(find . -type f | sort | xargs ls -l --time-style='+%Y-%m-%d' | awk '{print $6, $7}'); do
    file=$(echo "$line" | awk '{print $2}')
    echo "$line" $(cat "$file" | wc -l)
done

高速に実行できる方法​


一方で、次のコマンドは高速に全ファイルの結果を得ることができます。

Code:
find . -type f | sort | xargs ls -l --time-style='+%Y-%m-%d' | awk '{print $6, $7}'

Code:
2020-02-06 ./index.php
2023-01-01 ./license.txt
2023-07-06 ./readme.html
2023-05-13 ./wp-activate.php
2023-11-09 ./wp-admin/about.php
...

Code:
find . -type f | sort | xargs wc -l

Code:
      17 ./index.php
     384 ./license.txt
      97 ./readme.html
     218 ./wp-activate.php
     381 ./wp-admin/about.php
...

この ls -lwc -l の結果をマージしたような、冒頭に示した「得たい結果」を高速に得たいのですが、どのような方法が考えられるでしょうか。2つのコマンドの結果をマージするような方法があるのか、または「得たい結果」を高速に得るコマンドがあるのかについてお尋ねしたいです。

補足​


GNU bash 5.x を使っています。(もし例えば zsh なら簡単にできるなどあれば教えていただけると助かります)
 

Unreplied Threads

как указать независимый путь к папке с изображениями

Есть флешка на которой есть папка с изображениями и батник который их открывает, нужно чтобы путь был независимый до папки с изображениями, ибо приходится постоянно менять. Заранее спасибо.

Code:
for %%v in ("H:\folder\Test\*.jpg") do start "" "%%~v"

Python requests при post запросе встречается капча

Стоит задача купить определённый товар на Binance NFT (https://www.binance.com/en/nft/blindBox/market?theme=126206614880739328). Я использую python requests для отправки post запроса. Если я нажимую на кнопку покупки, то в network отправляется post запрос на recaptcha.net вот он

Как это можно обойти или пройти, если она даже не видна мне?

Как преобразовать коды ISO 3166-1 в название стран?

Например, хочу преобразовать этот массив:

Code:
countries=['CA', 'FR', ...]

в такой:

Code:
countries=['Канада', 'Франция', ...]

Breadboarding a Phaser and not getting an output?

  • Thxforhelping
  • Physics
  • Replies: 0
After following along with a hobbyist's video, I breadboarded a phaser. Unfortunately it seems my circuit is not achieving anything close to what the hobbyist achieved with his.

I believe the issue is related to my method of achieving an audio in signal as well potential problems with my audio out. For my audio out I have a cheap, unbranded speaker that is only powered via the input signal (3.5 mm audio jack). For my audio input, I was attempting to use a 3.5 mm audio jack from my cellphone that branches into three wires (brown and red for left and right stereo channels, black is ground).

The video I was following comes from Barbarach. He has a blogpost corresponding to the video: https://barbarach.com/breadboard-a-simple-phaser/

For those who want to see the video, here is the link:

From what I understand, a 3.5 mm audio jack is only really putting out a couple of milliwatts. When I analyze the signal directly with an oscilliscope, I get a signal that never seems to go past a peak voltage of 100mV. Analyzing the signal after each stage reveals more or less the same signal, with significantly more noise and slightly lower peak voltages.

Could I possibly rectify this issue by raising the gain of the first stage of this circuit? Does anyone notice any glaring issues with this circuit, or my attempt at it on the breadboard? When I hook up the phone's output directly to the speaker, it has no issue playing the sound (despite not being all that loud). I understand the impedance of the circuit could very well be lowering the power of the signal to a value that makes it impossible to hear. Or perhaps my only issue is that I need match my JFETs, since I know low quality control means even the same JFET can have very different values.

Phaser Schematic

Breadboarded Phaser

Comparison of two numbers of different length

  • Arinjoy Pramanik
  • Physics
  • Replies: 0
I want to design a circuit at block level using IC 7485 to compare one 6 bit number with another 5 bit number.
My approach is that I will put the most significant bits in the 4 inputs of the 7485 comparator considering both to be of same length by placing a 0 in front of the 5 bit number. I will then design a 2 bit comparator for the least 2 significant bits of the two numbers and use their output as my input to the IC. Is this approach correct?

Which is the best digital marketing institute in Chandigarh or Mohali?

Chandigarh Institute of Internet Marketing (CIIM) is the institute from which I have done the course of advance digital marketing. The thing is that I came to know about this institute from my friend she had also done the same course and applied for further course as well. After learning the course I also got placement letter for a well recognised company. The teachers are also very supportive and cooperative. If you are looking for a budget friendly course do visit and thank me later.

SharePoint Online List Lookup within the Same List

  1. I have only One SharePoint Online List.
  2. I want to use a Lookup using "ID" and "Prior ID" columns, in order get a Date added to the "Prior Date" Field.
  3. I want it to look like the table below.
  4. But currently, nothing is returned in the Prior Date field, it is empty.

enter image description here
Top