A command-line interface (or CLI) is a method of interacting with your OS or software by typing commands on your keyboard.

learn more… | top users | synonyms (3)

89
votes
22answers
202k views

How can I mass rename files?

I've got a bunch of files named with a the pattern 99 - DescriptiveName.txt and I'd like to remove the number from the front so I just have DescriptiveName.txt. How can I do this? Can I do it from ...
55
votes
17answers
236k views

Run a batch file in a completely hidden way

I'm looking for some way to run a batch file (.bat) without anything visible to the user (no window, no taskbar name, .etc..). I don't want to use some program to do that, I'm looking for something ...
17
votes
6answers
77k views

How to access the Administrator Command Prompt in Windows 8?

When I access the Run dialog in Windows 8 and type cmd, it opens a command prompt but it doesn't have administrative privileges. Looking for cmd at the default start screen does show a command prompt ...
112
votes
9answers
301k views

Using cd Command in Windows Command Line, Can't Navigate to D:\

This may be a stupid question, and I think I have looked elsewhere to find the answer... Might be a path issue, but when I open the command line and type from the C:\>: cd D:\ I cannot get to ...
28
votes
3answers
29k views

Assign a shortcut to running a script in OS X

Does OS X provide an easy way to bind key combinations to commands which are typically run on the command line? For example, is there some way to assign ⌘ Cmd+L as a global shortcut to quickly lock ...
326
votes
11answers
306k views

Is there any 'sudo' command for Windows?

I always work on a non-administrator account on my Windows computer. Sometimes I need to install programs which requires administrator access. As I mostly use the Windows command prompt, is there a ...
81
votes
4answers
27k views

Forward SSH traffic through a middle machine

SSH tunneling is very confusing to me. I am wondering if I can do this in Linux. I have 3 machines.. A. My local machine at home. B. Machine at work that I can SSH into (middle man). C. My desktop ...
90
votes
9answers
261k views

How can I put the computer to sleep from Command Prompt/Run menu?

I know that almost everything on Windows, like opening any sort of application, can be done from the command prompt or from the Run menu. How can I put my computer to sleep or shut it down? What is ...
41
votes
3answers
131k views

Turn off display in Windows on command

Is there a way to turn off the display in Windows (7), preferably without using additional software? Powershell script works fine, but leaves command-line window after turning on the display.
97
votes
8answers
38k views

Windows equivalent of whereis?

Is there an equivalent of the Unix whereis command in Windows? So that I could figure out where commands I can run actually is.
47
votes
3answers
73k views

How does the Windows RENAME command interpret wildcards?

How does the Windows RENAME (REN) command interpret wildcards? The built in HELP facility is of no help - it doesn't address wildcards at all. The Microsoft technet XP online help isn't much better. ...
139
votes
7answers
235k views

How do I find out what version of Linux I'm running?

Is there a way to determine what version (distribution & kernel version, I suppose) of Linux is running (from the command-line), that works on any Linux system?
87
votes
14answers
248k views

Is it possible to download using the Windows command line?

Without using any non-standard (Windows included) utilities, is it possible to download using the Windows command line? The preferred version is Windows XP, but it's also interesting to know for ...
31
votes
4answers
89k views

Remove USB device from command line

I'm constructing a backup script for Windows 7, and the last action I want it to perform is to safely "remove" the USB drive that it is backing up to. I am under the impression that plugging the drive ...
79
votes
6answers
136k views

How can I open a command prompt in current folder with a keyboard shortcut?

How can I open a command prompt in current folder with a keyboard shortcut in Windows 7? Is there any way to implement this? I think Autohotkey could do this, but don't know how.
65
votes
5answers
217k views

A command-line or batch cmd to concatenate multiple files

I have 50 text files in one directory. Is there a Windows command-line method to concatenate those files into a single file? I am using Windows Vista. I don't want to type the name of all files.
30
votes
10answers
93k views

On Windows 7, is there a command prompt line that can start cmd as an administrator? [duplicate]

On Linux, we can use sudo bash to run a shell as the superuser. On Windows 7, we can use Start menu -> (in search box, type) cmd -> Right click on search result and choose Run as Administrator ...
118
votes
8answers
137k views

Where does $PATH get set in OS X 10.6 Snow Leopard?

I type echo $PATH on the command line and get /opt/local/bin:/opt/local/sbin:/Users/andrew/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/pear/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/...
27
votes
12answers
87k views

Windows command that returns external IP

Is there a command by which I can find my external IP of my router or my NAT\DSL Router, etc., eliminating the need to visit whatsmyip.net or similar.
31
votes
6answers
41k views

There's no 'sudo' command in Cygwin

Because there's no sudo command in Cygwin, scripts that I want to run fail with ./install.sh: line N: sudo: command not found What's the standard way for getting around this? Editing the scripts ...
29
votes
7answers
64k views

Windows 7 Administrator Command Prompt “Start in” Path

So, I know you can create a shortcut to an administrator-level command prompt (as described in this question), but what I'm seeing is that whenever I use such a shortcut, it always drops me into c:\...
185
votes
8answers
13k views

What do the parentheses and number after a Unix command or C function mean?

I keep seeing parentheses and a number after a command in Unix or Linux or C function. For example: man(8), ftok(2), mount(8), etc. What do these mean? I see them in man too.
51
votes
6answers
51k views

Create an alias in Windows XP

Back in school, I used to have a .login file along the lines of alias ll = ls -l alias dir = ls -Fhl alias web = cd ~/public/public_www/development I'd like to do that sort of thing with my ...
81
votes
6answers
25k views

Does bash have a hook that is run before executing a command?

In bash, can I arrange for a function to be executed just before running a command? There is $PROMPT_COMMAND, which is executed before showing a prompt, i.e., just after running a command. Bash's $...
93
votes
8answers
94k views

How do I start Chrome using a specified “user profile”?

I use the new built-in "Users" feature of Chrome to switch between Home/Work accounts easily. However, Chrome remembers the "last" user profile you had selected when launching new windows. This is a ...
98
votes
2answers
217k views

Setting and getting windows environment variables from the command prompt?

This is a very basic question, but I can't find an answer. I want to set an environment variable from the command prompt and then be able to access it globally (for instance, I should see it by going ...
41
votes
2answers
116k views

CMD cd to other drives except C:\ not working [duplicate]

Possible Duplicate: Using cd Command in Windows Command Line, Can't Navigate to D:\ I am unable to cd D:\ or cd D: or to any other drives. I am facing this problem from last 2 months but ...
39
votes
14answers
164k views

How do you open the command prompt in Windows 7 with a shortcut key?

Is it possible to open the command prompt with Windows 7 with a shortcut key, and if it is, how do you do it? I know that I can assign a shortcut key to it, but does Windows come with a shortcut key ...
17
votes
5answers
49k views

Download a file via HTTP from a script in Windows

I want a way to download a file via HTTP given its URL (similar to how wget works). I have seen the answers to this question, but I have two changes to the requirements: I would like it to run on ...
26
votes
12answers
117k views

How to prevent the command prompt from closing after execution?

My problem is that in Windows, there are command line windows that close immediately after execution. To solve this, I want the default behavior to be that the window is kept open. Normally, this ...
2
votes
4answers
533 views

WinXP dir command: 3 and 4 char extensions are the same?

I'm trying to recursively search a directory tree to find all of the .asp files using the following command: dir *.asp /s For some reason, this returns not only the asp files, but also the aspx ...
56
votes
9answers
167k views

What is the command to use to put your computer to sleep (not hibernate)?

I want to put my Windows PC (Windows 7) into a sleep state via command line (so I can bind to macro button on keyboard). The power button on the PC is setup to but the computer to sleep (but it's ...
56
votes
12answers
31k views

How can I trigger a notification when a job/process ends?

The place I work at has commands that take a long time to execute. Is there a command/utility that I can use to notify me when the command execution is over? It could be a popup window or maybe a ...
32
votes
4answers
241k views

Can I invoke Windows Update from the command line?

It often happens that I have to watch this screen for minutes: I have no clue what's happening in the back. And I'm also not interested in watching the WindowsUpdate.log for changes. I would love ...
9
votes
1answer
29k views

Change Windows sound volume via the command line

Is it possible to change the volume in Windows XP via the command line?
11
votes
2answers
9k views

crossfade between 2 videos using ffmpeg

I've been trying to achieve a crossfade transition between 2 video clips using ffmpeg but have failed so far. I'm new to ffmpeg and am mostly relying on tweaking what I can find in the documentation ...
3
votes
2answers
15k views

How can I install updates and shut down from the command line?

I know that there is a simple way to shutdown the computer in command prompt, but is it possible to do system updates and then shutdown the computer in command prompt? For example, when Vista needs ...
129
votes
5answers
149k views

Using ffmpeg to cut up video

I am using ffmpeg to cut out a section of a large file like this: ffmpeg -i input.wmv -ss 60 -t 60 -acodec copy -vcodec copy output.wmv The -ss part works fine but the -t is ignored. It correctly ...
79
votes
13answers
120k views

How can I always run the command prompt as administrator?

As a developer, I often have the need to open a command prompt for various purposes. For example, I use iisreset to restart my local web server. I typically open the command window in one of two ways:...
59
votes
6answers
106k views

Can you browse a UNC path using a command line environment without mapping it to a network drive?

C:\> cd \\somewhere '\\somewhere' CMD does not support UNC paths as current directories. What I usually do to get around this is to map that directory to a network drive and then I could easily ...
64
votes
7answers
163k views

Run cURL commands from Windows console

Is there a way to install cURL in windows in order to run cURL commands from the command prompt?
42
votes
1answer
20k views

How to change the default terminal emulator on Windows (cmd)?

Is it possible to change the default terminal emulator on Windows (7 and 8 in particular) from Console to, for example, Console2 or ConEmu? In essence, I want all command line tools, whether launched ...
24
votes
4answers
11k views

Which special variables are available when writing a shell command for a context menu

When extending the Windows' shell context menu (e.g. for adding an 'Open command here' prompt on directories), a 'command' key needs to be created in the registry. The value of this 'command' key ...
37
votes
12answers
38k views

What commands can I use to reset and clear my terminal?

I have been using the command: reset to clear my terminal. Although I am pretty sure this is not what I should be doing. Reset, as the name suggests resets your entire terminal (changes lots of ...
27
votes
1answer
4k views

Is there a way to make bash more TAB friendly?

I use bash on both my Mac and as my cygwin shell. Overall, I'm quite pleased with it. My one complaint however is that its TAB completion isn't as good as Windows Command Line TAB completion. For ...
44
votes
5answers
67k views

Variables in batch file not being set when inside IF?

I have two examples of very simple batch files: Assigning a value to a variable: @echo off set FOO=1 echo FOO: %FOO% pause echo on Which, as expected, results in: FOO: 1 Press any key to ...
42
votes
5answers
13k views

What's the difference between one-dash and two-dashes for command prompt parameters?

I was wondering why is it that some programs requires their command prompt parameters to have two dashes in front whereas some (most) only require one dash in front? For example most programs look ...
37
votes
8answers
90k views

Take a screen shot from command line in Windows

I am looking for a way to take a screenshot of the entire screen from the command line. Operating system is Windows. Something like this: C:\>screenshot.exe screen1.png
19
votes
4answers
575 views

How to copy text in the Windows command line 'cmd'?

Is there any way to copy text that's shown in the Command Prompt window C:\Windows\system32\cmd.exe to the clipboard?
7
votes
5answers
2k views

Transparent Command Prompt in Vista?

Is it possible to have a slightly transparent command prompt window in Vista or Windows 7? Are they any 3rd party alternatives?