Şöyle yaparız
CMD Example: ren c:\exampledirectory\examplefileold.txt
c:\exampledirectory\examplefilenew.txtPowershell Example: rename-item -path "c:\exampledirectory\examplefileold.txt"
-newname "examplefilenew.txt"
CMD Example: ren c:\exampledirectory\examplefileold.txt
c:\exampledirectory\examplefilenew.txtPowershell Example: rename-item -path "c:\exampledirectory\examplefileold.txt"
-newname "examplefilenew.txt"
wsl -d <distrib> -u rootwsl ~ -d Debianwsl -u rootwsl --list --verbose
NAME STATE VERSION
* Ubuntu-22.04 Running 2wsl --set-default-version 2
PS C:\Users\user> wsl --status Default Distribution: Ubuntu-20.04 Default Version: 2 Windows Subsystem for Linux was last updated on 31.05.2022 WSL automatic updates are on. Kernel version: 5.10.102.1
WSL 2When the Windows Subsystem for Linux (WSL 1) was released in 2016, it became possible to run a real Linux dev environment in a Linux shell, while retaining the familiar Windows UX around the shell. Even File Explorer was integrated nicely with the Linux file system.The big drawbacks are that WSL 1 emulates a Linux kernel, and it runs in a full VM. The first means processes that require a native kernel, like Docker, can’t run. The second means that WSL 1 consumes a lot of resources. WSL 1 was not sufficient to run Kafka reliably.
But Microsoft delivered WSL 2 in 2019, and it’s a whole new world. They fixed the two biggest limitations, so WSL 2 runs a real Linux kernel, and the kernel runs on a subset of Hyper-V features, not in a full VM.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all
/norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
Apps installed from the Microsoft Store are not traditional Windows "executables". They are Appx packages with a manifest and resources, and they aren't launched with a traditional "command line."
wsl.exe or wsl should work. It can be found in C:\Windows\System32.
By default wsl2 enables wsl localhost to be accessible from windows but not vice versa.
grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'$ sudo apt install cifs-utils
$ sudo mount -t cifs -o user={user},pass={password},vers=1.0 //server/share /mnt/shareVariables that are declared as global in a DLL source code file are treated as global variables by the compiler and linker, but each process that loads a given DLL gets its own copy of that DLL's global variables. The scope of static variables is limited to the block in which the static variables are declared. As a result, each process has its own instance of the DLL global and static variables by default.
private static bool isConnected = false;
public static void Connect()
{
// TODO: Connect.
isConnected = true;
}
public static void Disconnect()
{
// TODO: Disconnect.
isConnected = false;
}$Str="This is the<BR />source string<BR />ALL RIGHT"
$Str.Split("<BR />")
This
is
the
(multiple blank lines)
source
string
(multiple blank lines)
ALL
IGHT
$Str -Split("<BR />")
This is the
source string
ALL RIGHT From this you can see that the string.split() method:- performs a case sensitive split (note that "ALL RIGHT" his split on the "R" but "broken" is not split on the "r")- treats the string as a list of possible characters to split onWhile the -split operator:- performs a case-insensitive comparison- only splits on the whole string
$string = 'FirstPart SecondPart'
$a,$b = $string.split(' ')
$a
$b$File = get-content "D:\test\1234.txt"
$OutputFile = foreach($line in $File){($line.split('|'))[0,4,1,2,3,5] -Join '|'}
$OutputFile | out-file -filepath "D:\test\4321.txt" -Encoding "ascii"$MilitaryDude = "Doe, Jane C LTC MMUA DCC 1stZAP/SFR"($MilitaryDude -split "DCC" | Select -First 1).Trim()
$object = Get-Content data.txt
$object.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Arrayforeach($line in Get-Content data.sql) {if($line.StartsWith('INSERT INTO')) {$startIndex = $line.IndexOf(''''');if ($startIndex -ne -1) {$endIndex = $line.IndexOf('''',$startIndex + 1)$length = $endIndex - $startIndex + 1Write-Output $line.SubString($startIndex,$length);}}}
Get-Content -Path "\\xx.xxx.xx.xxx\c$\App_configuration.txt"$text = Get-Content .\file.txt -Raw $filename="insert.txt"Remove-Item $filename$file1 = Get-Content -RAW .\file1.txt$file1lines = $file1.Split(';')$file2 = Get-Content -RAW .\file2.txt$file2lines = $file2.Split(';')foreach($file2line in file2lines) {$file2line = $file2line - replace "'n'r",""$file2line = $file2line.Trim()if($file2line.StartsWith('INSERT INTO')) {$startIndex = $file2line.IndexOf(''''');if ($startIndex -ne -1) {$endIndex = $file2line.IndexOf('''',$startIndex + 1)$length = $endIndex - $startIndex + 1$id = $file2line.SubString($startIndex,$length);$file1lines |foreach {if ($_.Contains($id) {$_ | Out-File -Append -FilePath $filename}}}}}