Cheatography
https://cheatography.com
Common Commands between the two main OSes (WIP)
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Basic commands
Linux |
Windows |
Notes |
ls |
dir /b |
The Windows command, by default, shows more information apart from names. |
ls -l |
dir /w |
ls -l | grep ^d |
dir /a:d |
ls -a |
dir /a:h |
cp |
copy |
cp -f |
copy /y |
cp -r |
xcopy |
rm |
del |
rm -r |
del |
This is not wrong. |
rm -f |
del /f |
clear |
cls |
Linux also supports this via Ctrl+L. |
uname |
ver |
chmod |
attrib |
|
whereis |
where |
cat |
type |
date |
time |
ps -aux |
tasklist |
kill <pid> |
taskkill /pid <pid> |
Windows uses process names by default, whereas Linux uses Process Identifiers (PIDs). |
pkill <pname> |
taskkill <pname> |
kill -9 <pid> |
taskkill /f /pid <pid> |
Networking
Linux |
Windows |
Notes |
ifconfig |
ipconfig |
ifconfig -a |
ipconfig /all |
ifdown <interface> |
ipconfig /release <interface> |
On Windows, if you do not specify an interface, it'll act on all of them. |
ifup <interface> |
ipconfig /renew <interface> |
On Windows, if you do not specify an interface, it'll act on all of them. |
traceroute |
tracert |
whoami |
whoami |
|
|
Invoking scripts from within scripts
On Linux, you just put the path to said script and it'll do the job. On Windows, you need the call
command as a prefix. Works the same, though. |
File permissions
|
|
Action |
Notes |
+r |
+r |
Allows for reading |
- |
+w |
-r |
Allows for writing |
Windows considers you can have read-onnly files or writable files, not both like Linux does. |
- |
+a |
Marks files as archived on a backup |
- |
- |
+h |
Marks files as hidden |
- |
- |
+i |
Allows file to be indexed |
- |
- |
+p |
Pins the file |
- |
+x |
- |
Allows the file to be executed |
Windows considers all files and directories executable if you can access them. |
|