Functionally the same as the Microsoft Robocopy (https://en.wikipedia.org/wiki/Robocopy) command below but with the benefits of compression and optionally specifying a user.
robocopy /e [//host]/source/path [//host]/destination/path
Options:
-a: archive mode - rescursive, copy symlinks as symlinks, preserve permissions, preserve modification times, preserve group, preserve owner, preserve device files and special files
-hh: Numbers in human-readable K=1024 format. Single "h" will produce human-readable K=1000 format
-m: don't copy empty directories
-z: use compression (if both source and destination are local it's faster to omit this)
--progress: Shows progress during the transfer and implies --verbose (verbose output)
--stats: Summary after the transfer stops
Show Sample Output
Also resolves hostname
IMPORTANT: You need Windows PowerShell to run this command - in your Windows Command Prompt, type
powershell
Create a log file of your Motorola Surfboard SB6141 downstream signal strengths.
Uses the built-in curl to request signal strength data from your SB6141 cable modem.
HTML page 192.168.100.1/cmSignalData.htm has the signal strength numbers for the 8 downstreams.
Some HTML/DOM processing parses out the 8 values from the above page.
The eight extracted signal strengths are then logged to a file.
A small while-loop watches the clock & repeats the process every 10 seconds.
Show Sample Output
IMPORTANT: You need Windows PowerShell to run this command - in your Windows Command Prompt, type
powershell
Uses sajb to start a PowerShell background job that pings an IP host every 10 seconds.
Any changes in the host's Up/Down state is time-stamped and logged to a file.
Date/time stamps are logged in two formats: Unix and human-readable.
A while(1) loop repeats the test every 10 seconds by using the sleep command.
See the Sample Output for more detail.
I use this command to log Up/Down events of my Motorola SB6141 cable modem (192.168.100.1).
To end the logging, close the PowerShell window or use the "exit" command.
Show Sample Output
List local accounts and their SIDs (*-500 is the original local Administrator, *-501 is the original local Guest, more below). This is helpful in identifying local accounts that are not disabled, don't have an expiring password, etc. Well-Known SIDs https://support.microsoft.com/en-us/kb/243330 Show Sample Output
Unblock multiple windows files using Powershell. -Recurse is optional to apply to all directories recursively.
Commandline for windows + cygwin with specific interface and resolved ip.
The Windows Subsystem for Linux (WSL) is a compatibility layer for running binary Linux executables natively in Windows. A folder such as "C:\Program Files (x86)\Common Files" is represented as "/mnt/c/Program Files (x86)/Common Files". This function allows you to change the current directory to a Windows folder. Show Sample Output
Lower PowerShell priority, so that to launch processes in the background and work normally with other applications Show Sample Output
Bulk downloads the comic strip JPG files for the adult cartoon Savitabhabhi, storing each set in it's own folder. Requires manual removal of "non-image" files that maybe created because each series may differ in length. The command can be easily adapted for UNIX flavours. You need to have cURL in your path.
Usually the MS-DOS cmd.exe processes in the whole FOR loop as one command and expands each var like %varname% in before (except the loop var of course).
This command enables expansion of other vars than only the loop var during the FOR loop. The syntax of the var to expand is then !varname! inside the FOR loop.
Use command
endlocal
to end the setlocal command.
E.g. (only works from batch files, not from commandline directly):
@echo off
setlocal enabledelayedexpansion
FOR %%A IN (*) DO (
set file=%%A
echo !file!
)
endlocal
The command line can be accessed by using the cmd command which will open a command window with a DOS interface. The command line is a throw back to the early days of computing before there was a Windows interface. Show Sample Output
This command should be copy-pasted in Windows, but very similar one will work on Linux. It uses wget and sed.
also shows the ethernet adapter Show Sample Output
Loops over array of a system var, splits its values and puts the values into %A, %B, %C, %D, and so on.
Create array before, like
set ARRAY[0]=test1,100
and
set ARRAY[1]=test2,200
Be sure to replace %A, %B, etc. with %%A, %%B, etc. when using this from inside of batch files.
Show Sample Output
How to add an "alternate access mapping" from the command line and avoid passing on Friday evening following the interpretation of the all-too-terse "log" of SharePoint?
Interacting with Active Directory to add users from one group to another group. This prevents from having to deal with long DNs and copying, pasting problems. It executes once per returned object.
This command defragment the SQLite databases found in the home folder of the current Windows user.
This is usefull to speed up Firefox startup.
The executable sqlite3.exe must be located in PATH or in the current folder.
In a script use:
for /f "delims==" %%a in (' dir "%USERPROFILE%\*.sqlite" /s/b ') do echo vacuum;|"sqlite3.exe" "%%a"
Show Sample Output
This command loops over all indexes of the system variable array ARRAY[] and puts its content into %A.
Create this array before, e.g. by
set ARRAY[0]=test1
and
set ARRAY[1]=test2
For using inside of a batch file, write %%A instead of %A.
Show Sample Output
Get windows version with servicepack and hostname Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: