Code examples
Useful Commands
Generate random hexadecimal string
Check file hash
Mac:
shasum -a 256 /path/to/file
md5 /path/to/file
Windows:
Certutil -hashfile \path\ SHA256
- run "
diskpart" (win + R)
- commands:
list disk
select disk #
attributes disk clear readonly
clean
create partition primary
format fs=exFAT
exit
Create folders for each filename and move files into them
WINDOWS:
| folders-per-filename.ps1 |
|---|
| Get-ChildItem -File | ForEach-Object {
$folderName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
$newFolderPath = Join-Path -Path $_.DirectoryName -ChildPath $folderName
New-Item -ItemType Directory -Path $newFolderPath -Force | Out-Null
Move-Item -Path $_.FullName -Destination $newFolderPath -Force
}
|
BASH: