Blog Archive

Friday, February 14, 2020

[cheatsheet] DOS/C++/ Python



https://www.hoomanb.com/cs/quickref/CppQuickRef.pdf


https://web.pa.msu.edu/people/duxbury/courses/phy480/python_refcard.pdf

http://www.cs.columbia.edu/~sedwards/classes/2015/1102-fall/Command%20Prompt%20Cheatsheet.pdf

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc754340(v=ws.11)?redirectedfrom=MSDN

https://peoplesofttutorial.com/ms-dos-command-reference-cheat-sheet/


dos:

doskey /history > historyLog.txt
dir someDir\subDir
cd filepath chdir filepath
cd .. (goes one directory up)
md mkdir Creates a folder (directory)
md folder-name
mkdir folder-name

rm folder-name
rmdir folder-name
rm /s folder-name
rmdir /s folder-name
Note: if the folder isn’t empty, you must add the /s.

 Copies a file from one location to another
copy filepath-from filepath-to

move Moves file from one folder to another
move folder1\file.txt folder2\ ren

 rename Changes the name of a file
ren file1 file2

del
Deletes one or more files
del filename

exit Exits batch script or current command control
exit

echo Used to display a message or to turn off/on messages in batch scripts
echo message

type Displays contents of a text file
type myfile.txt

fc Compares two files and displays the difference between them
fc file1 file2

cls Clears the screen
cls
Ctrl + Home will clear all characters in the command input to the left of the cursor.
Ctrl + End does the same for all characters to the right of the cursor.

cmp:compare the size of two files
cmp file1 file2

fc: This batch command lists the actual differences between two files.
fc file1 file2


find: This batch command searches for a string in files or input, outputting matching lines.
find "pattern" fileToBeSearched

set: Displays the list of environment variables on the current system. It can also set or remove

help Provides more details about DOS/Command Prompt commands

help (lists all commands)

help command
command /?

whoami displays domain\userName
whoami

pushd
Stores the current directory for use by the popd command, and then changes to the specified directory. For examples of how to use this command, see Examples. Syntax Copy pushd [<Path>]

How to get help:
1) Unix: man yourCmd

2) Python: help(yourCmd)

https://en.wikibooks.org/wiki/Python_Programming/Self_Help
help()      # Starts an interactive help
help("topics")  # Outputs the list of help topics
help("OPERATORS") # Shows help on the topic of operators
help("len")    # Shows help on len function
help("re")    # Shows help on re module
help("re.sub")  # Shows help on sub function from re module
help(len)     # Shows help on the object passed, the len function
help([].pop)   # Shows help on the pop function of a list
dir([])      # Outputs a list of attributes of a list, which includes functions
import re
help(re)     # Shows help on the help module
help(re.sub)   # Shows help on the sub function of re module
help(1)      # Shows help on int type
help([])     # Shows help on list type
help(def)     # Fails: def is a keyword that does not refer to an object
help("def")    # Shows help on function definitions


3) DOS: help yourCmd   (Option2: yourCmd /?)

No comments:

Post a Comment