The Computer Oracle

How to reduce the pain of the command prompt

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island Looping

--

Chapters
00:00 How To Reduce The Pain Of The Command Prompt
00:35 Answer 1 Score 45
01:21 Accepted Answer Score 33
01:48 Answer 3 Score 27
02:09 Answer 4 Score 21
02:27 Answer 5 Score 15
02:38 Thank you

--

Full question
https://superuser.com/questions/33366/ho...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows #commandline

#avk47



ANSWER 1

Score 45


You can use the Tab key to auto-complete file names. Although keep in mind you must first type enough of the file name to uniquely identify it or else you will have to shuffle through incorrect matches. For example, you have a folder with these files and it is your current directory that you're sitting in with cmd:

.
..
Su.exe
Sup.txt
SuperUser.COM

if you wanted to auto-complete SuperUser.COM, you would have to type supe then press Tab, since none of the other files start with those 4 characters. Note that if you had typed su and then pressed Tab, you could press Tab twice more to reach SuperUser.COM or you could type ShiftTab to go backwards through the list and get there.

Another trick is if you have the file in an explorer window, you can drag it into the cmd window and it will type the name out for you.




ACCEPTED ANSWER

Score 33


If you intend to use the command prompt only under Windows, you could use Windows PowerShell, as it is easier to use than the initial command prompt, and copies some behavior from the *nix-like terminals. (It provides also a lot more functionalities, but at first, at least to me, it's an "easier command shell").

picture of powershell

Edit: Changed picture for a more "friendly" one.




ANSWER 3

Score 27


Here are some more tips and tricks in using the command prompt including:

"...drag n' drop files or folders from an explorer window into a command prompt; this inserts the quoted path as if you had manually pasted it..."

This is yet another way to reduce the amount of typing involved in long file paths.




ANSWER 4

Score 21


Here’s the complete list of function key actions :

F1 retypes the previous command one character at a time
F2 brings up a dialog and asks “Enter the char to copy up to:”
F3 retypes the last command in full
F4 brings up a dialog and asks “Enter char to delete up to:”
F5 as for F3
F6 Print EOF character (Ctrl+Z)
F7 brings up a dialog of all the recent command history
F8 brings up each of the most recent commands, one at a time
F9 brings up a dialog and asks “Enter command number:”



ANSWER 5

Score 15


Pressing F7 will list the last executed commands.

cd \ to get back to the c: directory.