Moving between OS types can be a pain. How many times have you typed ls into a windows machine when trying to list the files in a directory? This is a handy dandy guide comparing commands between the two.
It will be updated over time as we get requests or as we feel it is justified.
Linux | Windows |
ls | dir |
Both ls and dir list the contents of a directory | |
Pwd | echo %cd% |
Print the current directory | |
Who | whoami |
Print the current user | |
cat <filename> | type <filename> |
Print the contents of a file to the screen | |
> and >> | > and >> |
Send the contents of cat or type to another file. | > overwrites the target file >> appends to the end of file |
Strings | [none] |
Prints human readable content from binary files | SysInternals has a downloadable Windows equivalent |
cron | At |
Schedule tasks to run at a specific time | |
ps aux | tasklist /v |
Print the list of running tasks | |
grep <search string> | find |
Search for a pattern in a file | |
| – (SHIFT + \ usually) | | |
Send the output of one command as the input to | the next command |
ifconfigiwconfig | Ipconfig |
Print network settings. iwconfig prints wireless | network settings in linux. |
hostname | Hostname |
Print the computer name |
Pipe usage:
Command1 | Command2
Search a file for a string in Linux:
cat samplefile.txt | grep secret
Search a file for a string in Windows:
type samplefile.txt | find /I secret
/I ignores the case of the search string
May I simply just say what a relief to discover a person that actually understands what they’re talking about over the internet.
You certainly understand how to bring a problem to light and make it important.
More and more people need to look at this and understand this side of the
story. I was surprised you’re not more popular given that you most certainly possess
the gift.