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)

6
votes
6answers
19k views

Move files from multiple folders all into parent directory with command prompt

I have multiple .rar files in multiple folders like this: C:\Docs\Folder1\rarfile1-1.rar C:\Docs\Folder1\rarfile1-2.rar C:\Docs\Folder1\rarfile1-3.rar C:\Docs\Folder2\rarfile2-1.rar ...
5
votes
1answer
7k views

How to mount an NTFS filesystem, allowing all users full access?

How could I mount an NTFS filesystem in a way that would allow all users full access to it? If I use sudo mount -t ntfs /dev/sda1 /media/drive, then only the root user can use it. It won't let me ...
5
votes
5answers
9k views

How to change the default color of the Command Prompt?

I want to change the color scheme of the command prompt in Windows, ideally a default of 0a (green color on black background). How can I change this?
5
votes
2answers
3k views

Using command line to connect to a wireless network with an http login

I'm trying to connect to a wifi network where it hijacks all requests and redirects you to a page where you have to agree to a terms of use before it lets you connect to the actual outside world. This ...
4
votes
5answers
2k views

Can I add a Windows Explorer context menu option to start command prompt in the selected directory?

When browsing in Windows Explorer, sometimes I want to start a command prompt "here", e.g. with the current browsed folder as the current directory. For example, when I am browsing "D:\Foo\Bar\Bar1", ...
4
votes
2answers
2k views

Write a DVD from the Windows Command Line

Does anyone know an easy way to write files to a DVD from the command line. I've found a program that does it for CDs, and another that writes .ISO images to DVD. I want to use it to write files to a ...
3
votes
4answers
37k views

RocketTab is uninstalled but still haunt me

Every time I start my computer a command prompt and window will pop up saying "Windows cannot find 'C:\Program Files (x86)\RocketTab\Client.exe' Make sure you typed the name correctly, and then ...
3
votes
3answers
5k views

How can I reset network (Airport) connections from the command line?

I have this MacBook Pro that has intermittent problems connecting to my WiFi network. Sometimes it helps to disable/re-enable Airport and sometimes I have to restart the computer to get my network ...
3
votes
2answers
264 views

How do I open Windows Explorer to a particular directory from a Windows command prompt?

When I'm in a particular directory in a Windows command prompt, I sometimes want to open Windows Explorer so it already shows that same directory. How do I do that? (I'm looking for the equivalent ...
2
votes
2answers
6k views

Undoing the Last Installed Windows Updates via Command Line

Using the command line, how can I undo the last installed windows updates?
1
vote
3answers
2k views

Modification of files with 777 permissions but not with 755 permissions?

I can modify the files with 777 permissions, but not with 755. I do it by sourcing some sed commands. I find it odd because I can modify the files with even 700 permissions in Vim. Why is it not ...
0
votes
1answer
3k views

Change a drive letter from Command Prompt or batch script in Windows 8?

I have an external hard drive that I connect often to my computer. At some point it was assigned letter G: and based on that my other software works. Nowadays, suddenly it gets letter F: Is there ...
0
votes
2answers
3k views

Disable “Auto Restart after BSOD” from Command Line

I just did a major system upgrade (CPU, MB, RAM). The old HD doesn't like my new equipment (which resulted in a BSOD). I feel like I could fix the issue if I knew how to disable the auto-restart. How ...
69
votes
11answers
37k views

OS X: Base64 encode via command line

Is there a terminal command in Mac OS X which will base64 encode a file or stdin?
26
votes
6answers
7k views

What zsh features do you use? [closed]

I do a lot of work in the terminal so I have learned a lot about my shell of choice, zsh. What features of zsh do you use to make yourself that much more productive at work? One of my favorites is ...
34
votes
3answers
48k views

Save a single web page (with background images) with Wget

I want to use Wget to save single web pages (not recursively, not whole sites) for reference. Much like Firefox's "Web Page, complete". My first problem is: I can't get Wget to save background images ...
91
votes
5answers
167k views

How to recursively delete directory from command line in windows?

What is the windows equivalent of rm -r [directory-name]?
43
votes
4answers
53k views

What does “2>&1” do in command line?

I know that the > sign is used for output redirection in the command line, but I'm having trouble finding something that explains the use of 2>&1 in the command line. For example: curl ...
33
votes
6answers
45k views

How do I use 7-zip to backup files, but exclude some directories

I would like to use 7-zip to backup a directory, but I would like it to exclude all directories named ".svn" (anywhere in the source tree). Does anybody know if this is possible and in that case how?
30
votes
6answers
17k 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 ...
17
votes
5answers
3k views

Good PowerShell guide, getting started through more advanced usage

Does anyone have a really good tutorial or getting started guide for Microsoft's PowerShell? I'm a long time Linux/Unix user, and very familiar with scripting languages, command-line usage with bash, ...
27
votes
5answers
41k views

How do I get the size of a Linux or Mac OS X directory from the command-line? [duplicate]

What command do I use to find the size of all the files (recursively) in a Linux or Mac OS X directory?
33
votes
8answers
92k views

Hibernate computer from command line on Windows 7

I am trying to hibernate my computer from the command. I was using shutdown /s /t 20 to shutdown the the computer. I change /s to /h to hibernate and now it just returns the usage text as if it ...
18
votes
6answers
42k views

List all members of a group (Mac OS X)

I've tried Googling but not getting anywhere. How can I list all the members of a group called mygroup from the command-line in OS X? $dscl . list /groups will get me all the groups...but how can i ...
36
votes
7answers
61k views

Recursively delete empty directories in Windows

I have a directory on my Windows 7 machine that has hundreds if not thousands of sub-directories. Some of them have files, some do not. I want to delete all the empty directories. Looking at the ...
15
votes
4answers
3k views

A command before every bash command

Does anyone know a mean of putting a 'time' command before every command in a bash session?
24
votes
1answer
32k views

Show only current directory name (not full path) on bash prompt

The way my bash prompt is currently configured, it shows the whole path to the current directory. This is annoying when I'm deep inside a directory tree, as the prompt becomes so long that every ...
19
votes
1answer
8k views

Use terminal scrollbar with tmux

I know how to scroll in tmux using the keyboard, but I noticed that it looks like there's a way to use the terminal scrollbar with GNU Screen. Can this be done with tmux?
12
votes
1answer
6k views

pfctl port forwarding in Mac osx?

-A PREROUTING -s 10.0.10.0/24 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 -A PREROUTING -s 10.0.10.0/24 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8080 -A POSTROUTING -s 10.0.10.0/24 -o ...
10
votes
3answers
22k views

Recursively rename files (change extension) in Linux

How do I rename all files in a directory, recursively, changing one file extension to another, for thousands of files in thousands of subfolders? I see a lot of commands that do almost what I want, ...
10
votes
3answers
13k views

Simple built-in way to encrypt and decrypt a file on a Mac via command-line?

Are there any built in command-line tools that I can encrypt and decrypt a text file (and provide it some sort of password).
20
votes
3answers
6k views

Best practice for Windows PATH/environment variables managing?

Right now, it's such a mess. Every time I install a new program that does something trivial in the command line, I have to add it to the path. In fact, I'm developing on Ruby and even gems ...
11
votes
6answers
16k views

Converting a PDF to black & white with ghostscript

Similarly to this question: Convert a PDF to greyscale on the command line in FLOSS? I have a PDF-document and want to convert it to pure black and white. So I want to discard halftones. To ...
41
votes
5answers
46k views

Execute multiple commands with 1 line in Windows commandline?

How can I execute multiple commands in the Windows commandline with just a single line? So for example say I want to perform an SVN update and then copy all of the files to another location... svn ...
30
votes
9answers
36k views

Is there a shortcut command in Windows command prompt to get to the current users home directory like there is in Linux?

I am used to using cd ~ to get right into my home directory. In windows command prompt I have to do cd Users\username to get there. Is there a shortcut like the Linux one? It would be nice if I ...
26
votes
3answers
68k views

How do I log out of `sudo su`?

I'm using sudo su to start mysql and do some homework with it. When I finish with mysql (or any other command), then I'm still in sudo. How do I "log out", so my prompt changes back from # to $?
8
votes
2answers
42k views

Windows 7: how can I add an IP range in the “route” command?

I'm using two network connections, and I tried using the "route" command so that when I access a specific internal IP on my LAN, it would use connection 1, anything else would go normally through ...
28
votes
4answers
80k views

How do I escape spaces in command line in Windows without using quotation marks?

For example what is the alternative to this command without quotation marks: CD "c:\Documents and Settings" The full reason I don't want to use quotation marks is that this command DOES work: ...
14
votes
2answers
31k views

How to detect the speed (fast or gigabit ethernet) of a network connection over Windows command line

To troubleshoot a network problem I would like to inquire the real network "speed" for a given network adapter, which can be seen when opening the "status" of a network connection under Windows: ...
35
votes
3answers
18k views

How do I execute multiple commands when using find?

I'm trying to run multiple commands on things I have found, how can I achieve this? find . -exec cmd1; cmd2 does not seem to work; it instead runs cmd2 after cmd1 has been executed on every file.
12
votes
5answers
9k views

How do I full-screen my CMD? [duplicate]

I work a LOT in the windows command line. Unlike other windows, it doesn't maximize - it just goes a big as it can depending on the buffer size. Is there any way I can get the CMD to act like the ...
32
votes
6answers
33k views

scp to remote server with sudo

I have a file on server A (which is behind a NAT so not directly addressable). The file needs to be copied to server B in a directory restricted to root. I have an account on server B with sudo ...
14
votes
1answer
2k views

Why do we have login, non-login, interactive, and non-interactive bash shells?

So the bash man pages explain what login and interactive shells are: A login shell is one whose first character of argument zero is a -, or one started with the --login option. An ...
11
votes
5answers
25k views

How can I count the number of folders in a drive using Linux?

I need to organise an external HDD such that there is no more than 500 folders on it. Ubuntu's "Properties" pane shows only the file count, not the folder count. Is there a simple command line that ...
9
votes
5answers
12k views

How to set Title of CMD to current working Directory in Windows XP

How does one set the title of the of the Command Prompt (CMD) in Windows XP to the current working directory dynamically ? I can use title %CD% however, this is a temporary fix and the title ...
5
votes
1answer
36k views

How to get filename only without path in windows command line?

for /r %f in (*) do echo %f Gives the output filename along with the entire path \path\to\dir\<filename> How do i get just the <filename> without the path included? I need to use that ...
23
votes
4answers
15k views

Elevated command line prompt can't access shared drives in Windows 7

I map a share from another machine using my user account. I launch an elevated command prompt (cmd.exe, right click, Run as administrator). Navigating to shared drive (Z:) results in: The system ...
13
votes
4answers
52k views

change directory command doesn't work in windows command prompt [duplicate]

Possible Duplicate: Using cd Command in Windows Command Line, Can’t Navigate to D:\ Somehow cd command is not working in windows command prompt when I want to change the drive. For ...
12
votes
1answer
81k views

Batch file that runs cmd.exe, a command, and then stays open at prompt

I would like to make a batch file that: Opens cmd.exe Within that Command Prompt runs net use to display mapped share paths Leaves the window open so that I can run additional commands if I wish to ...
11
votes
7answers
5k views

Good Alternative to Cygwin with Copy/Paste?

I am annoyed that I can't copy and paste into Cygwin... is there a good alternative to Cygwin that will let me do this?