How large is a disk sector anyway? [closed] - stat

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 1 year ago.
Improve this question
So, since ages I have been told that hard disks (I am specifically interested in HDDs and not SSDs) write data in units of 512 bytes, sectors. But when I interrogate the folder with stat . then I get told that blocks are 4096 bytes. How do I find out the sector size for the HDD and not the filesystem?
$ stat .
Plik: .
rozmiar: 4096 bloków: 8 bloki I/O: 4096 katalog
Urządzenie: fd01h/64769d inody: 58327220 dowiązań: 8
Dostęp: (0755/drwxr-xr-x) Uid: ( 1000/arkadiusz) Gid: ( 1000/arkadiusz)
Dostęp: 2021-12-21 18:53:44.275157484 +0100
Modyfikacja: 2021-12-16 23:35:35.206793831 +0100
Zmiana: 2021-12-16 23:35:35.206793831 +0100
Utworzenie: 2018-09-09 04:23:32.113656998 +0200

Wiki clearly states that 512-byte sector is the normal,
unless we are talking about Advanced Format standard of 4K (4096 bytes).
As per comment: use sudo fdisk -x /dev/sda to get all the info you are looking for.

Related

How to get IST in Unix if my current timezone is UTC. Also I need to get the time format to be dd/mm/yyyy hr:min:sec? [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 last year.
Improve this question
I have just started learning about the date command in Unix.
I have typed the below code to get the IST. But I don't know how to convert it to a specific format.
TZ = IST-5:30 date
This gives the result as Thu Feb 10:31:51 IST 2022.
But I want the output to be 03/02/2022 10:31:51 IST.
Is there any way to get the output?
With date (GNU coreutils) 8.32 you can use the +FORMAT argument:
TZ=IST-5:30 date +'%d/%m/%y %T %Z'
03/02/22 10:46:50 IST
%x would be a better choice instead of %d/%m/%y if your locale allows for it.

Defrag system hdd only if is mechanical disk [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 1 year ago.
Improve this question
we needed some help. in practice we were looking for a method to start the defremmentation (defrag) of the primary disk (on windows "C:") only if it is a HDD and not an SSD
we read about the command in powershell but can't compile (mediaType)
This script should work for you:
#Get friendly name of the C drive
$name = (get-partition -DriveLetter C | get-disk).FriendlyName
#Use friendly name to determine drive type
$mediatype = (Get-PhysicalDisk -FriendlyName $name).MediaType
#Defragment drive if drive type is HDD
if ($mediatype -eq "HDD")
{
Optimize-Volume -DriveLetter C
}

Collect Senders Email Addresses From Specific Folder At Thunderbird [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 3 years ago.
Improve this question
as my title mentioned I am searching for a solution to get all email addresses that I have received from people and saved inside a certain folder in my Thunderbird.
I need them for marketing purposes, because those email addresses belong to people I have done business with.
Thanks for help.
Best
RS
You can use Message Filter in order to organize your messages.
Read this article: https://support.mozilla.org/en-US/kb/organize-your-messages-using-filters
Updated:
Select all the emails in that folder and saved them on a directory as a *.eml file format.
In the terminal: cd /path/to/eml/directory Then run:
find . -type f -exec cat {} \; | nl | grep "From" | grep -o '[[:alnum:]+\.\_\-]*#[[:alnum:]+\.\_\-]*' | uniq -ui | sort > collected-emails.csv
Now, All the collected emails will be saved in collected-emails.csv

How do I extract the first x lines from a large CSV file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 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.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Improve this question
How do I extract the first 100,000 lines from a large CSV file (1GB+) using only Powershell on a Windows machine?
Not sure why the below answer was marked as not helpful when it answers the question.
-TotalCount<Int64>
Gets the specified number of lines from the beginning of a file or other item. The default is -1 (all lines).
You can use the "TotalCount" parameter name or its aliases, "First" or "Head".
The performance of the command can be improved by
Get-Content -TotalCount 100000 -ReadCount 0 filename.csv
Get-Content -TotalCount 100000 filename.csv

Correct way of deleting items in a numbered list? [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 8 years ago.
Improve this question
I have a numbered list in org-mode like
1. A
2. B
3. C
4. D
Now when I kill the second line the list incorrectly gets ordered as,
1. A
3. C
4. D
instead of
1. A
2. C
3. D
I know I can always re-order the list before deleting something, but for long lists this becomes a hassle.
Is there a smarter way to avoid this?
You can kill such lines with no fear in mind. Just use C-c C-c afterwards, or S-right and S-left to go back to the previous list style (with up-to-date numbers).