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)

49
votes
5answers
140k views

Any command-line or batch cmd to concatenate multiple files?

I have 50 text files in one dir. 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.
48
votes
9answers
63k views

How do I add a user to multiple groups in Ubuntu?

What's the command line utility and the arguments it requires?
47
votes
8answers
27k views

How can I open a file read-only from command line with emacs/vi/vim

Is there a way to tell emacs/vi/vim (from the command line) that I want to view the file in view-mode or read-only. I know how to open a file as read only if emacs/vi/vim is already running.
47
votes
7answers
45k 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 ...
43
votes
4answers
52k 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 ...
42
votes
6answers
59k views

How to list folders using bash commands?

Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )
42
votes
7answers
94k views

How to check if a directory exists in Windows?

I would like to translate this Linux/Bash script to Windows shell: if test -d myDirName; then echo "ok"; else mkdir myDirName; fi It tests if a directory exists, and if it doesn't it creates it.
41
votes
11answers
32k views

Command-line application for converting SVG to PNG on Mac OS X

Are there any command-line programs that can convert an SVG to PNG, that run on Mac OS X? Edit: Dylan B had a good answer with ImageMagick. For reference, to install ImageMagick with SVG support on ...
41
votes
2answers
5k views

what is the difference between “command && command” and “command ; command”

I see these two usage on Ubuntu "command && command" and "command ; command", e.g. apt-get update && apt-get upgrade What would differ if I use apt-get update; apt-get upgrade? I ...
41
votes
8answers
35k views

Multi-tab command prompt in Windows?

What are the best (i.e. bug free) Multi-tab command prompts in Windows? They have them for Linux but Windows never seems to come out with one.
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 ...
41
votes
6answers
14k views

Linux / OS X tar incompatibility – tarballs created on OS X give errors when untarred in Linux

When I tar up files on my Macbook and untar them in Linux, I repeatedly get the following warnings/errors: tar: Ignoring unknown extended header keyword `SCHILY.ino' tar: Ignoring unknown extended ...
41
votes
2answers
6k views

'less' command clearing screen upon exit - how to switch it off?

How to force the less program to not clear the screen upon exit? I'd like it to behave like git log command: it leaves the recently seen page on screen upon exiting it does not exit the less even ...
40
votes
5answers
75k views

How do I determine if my Windows is 32-bit or 64-bit using a command? [duplicate]

Possible Duplicates: How to tell if a computer has a 64-bit CPU or OS Detect Windows Server version 32/64-bit in CLI OS version: 32-bit or 64-bit? How do I determine if my Windows ...
40
votes
6answers
97k views

How do I restart Linux (Ubuntu) from the command-line?

Because of my problem with mouse-clicks being ignored in Ubuntu, I want to restart from the command-line. (I have an open Terminal, and the keyboard is not ignored.) How do I restart a computer ...
40
votes
8answers
75k views

Command-line (cmd) command to lock a windows machine

Is there a way to lock a Windows XP machine via the command line? The shutdown command doesn't have an option for it.
38
votes
19answers
5k views

How to reduce the pain of the command prompt

I want to learn to use the command prompt better on Windows to have more control over what I do and just for the learning experience. The main annoyance I have right now is all of the typing. If I ...
38
votes
5answers
11k views

Is there a shortcut to mkdir foo and immediately cd into it?

This is something I do frequently $ mkdir foo $ cd foo This works as a single command, but it's more keystrokes and saves no time. $ mkdir foo && cd foo Is there a shortcut for this? ...
37
votes
17answers
4k views

How to delete a file that contains a backslash in the name under Windows 7? [duplicate]

Possible Duplicate: How to force Windows XP to rename a file with a special character? how to delete (invalid) files with colon in their name under windows I want to delete a file named ...
37
votes
2answers
38k views

How do I run multiple commands on one line in Powershell?

In cmd prompt, you can run two commands on one line like so: ipconfig /release & ipconfig /renew When I run this command in PowerShell, I get: Ampersand not allowed. The & operator is ...
37
votes
4answers
23k views

Mac OS X “say” command in Ubuntu?

Is there an equivalent to the Mac's terminal command "say" in Ubuntu 9.10?
37
votes
3answers
40k 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. ...
37
votes
5answers
59k 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 ...
36
votes
3answers
54k views

How can I change shell in Ubuntu? [duplicate]

I have a Ubuntu Server VPS and I want to use /bin/bash/ as my shell. How can I change my shell? I have root access but I don't work as root. So dash is my default shell now. I have read How do I make ...
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 ...
36
votes
3answers
122k views

List mapped network drives from the command line to text file

Is there a command that can be used from the command line to output a list of the mapped network drives on the local system and their location on the network to a text file? This will only be used on ...
35
votes
4answers
9k views

Linux equivalent command for “open” command on Mac/Windows?

Coming from Mac OS X, you can type: $ open yourfilehere.txt and your file will open just as if you had opened it from Finder. On Windows, one can type: > start yourfilehere.txt and it will ...
35
votes
3answers
17k 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.
35
votes
2answers
841 views

How do I teach my linux command line manners?

Whenever I complete something in the command line while using Ubuntu and my computer does something of value to me, I enjoy saying thank you, just because it's the polite thing to do. A typical ...
34
votes
5answers
5k views

What is the equivalent of Linux's “~” (tilde) in Windows?

In Linux, we can go to the user home by entering the tilde (~) character after cd: cd ~ How to do the same in Windows? Each time, I need to type: cd C:\Document and Settings\freewind That's too ...
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 ...
34
votes
9answers
74k views

How can I run an application with command line arguments in Mac OS

Is there any easy way to append command line arguments to an application on a Mac? For example, to run Opera in kiosk mode or to use a different profile in Firefox, I can type $ ...
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 ...
33
votes
12answers
60k views

Which command can I use to recursively rename or move a file in Windows?

What command in Windows emulates the recursive move / rename command from Unix?
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?
33
votes
7answers
29k views

Windows equivalent to UNIX “time” command

So, Unix has a time command that lets users time their code/other things. I was wondering if the Windows command line has anything similar. Also, I asked a previous question regarding the Linux ...
33
votes
2answers
16k views

How do I access MTP devices on the command line in Windows?

Most MTP (Media Transfer Protocol) devices in show up in Windows Explorer under their device name or a GUID, but don't have a drive letter assigned. How can I access the files on such devices from ...
32
votes
16answers
153k 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 ...
32
votes
2answers
6k views

What does the command “sudo !!” mean?

I saw the command sudo !! in a video. What does this mean?
32
votes
8answers
72k views

How to make a shortcut from CMD?

How can I create a shortcut file (.lnk) to another file or executable, using command line utilities?
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 ...
32
votes
5answers
8k 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 ...
31
votes
8answers
22k views

How can I delete Time Machine files using the commandline

I want to delete some files/directories from my Time Machine Partition using rm, but am unable to do so. I'm pretty sure the problem is related to some sort of access control extended attributes on ...
31
votes
3answers
15k views

“net start service” and “sc start”. What is the difference?

Services can be stopped and started using two commands in Command Prompt Shell. net start service "some service" sc start "some service" what is the difference between these commands?
31
votes
3answers
59k views

Command to unlock “Locked” files on OS X

I copied a lot of read-only files from a Windows system to my Mac. When viewing the Info for each file using "Get Info", I can see they are Locked. I'm writing a bash script to copy over some files ...
31
votes
1answer
48k views

Linux unzip command: Option to force overwrite?

I am writing a shell script that unzips a ZIP file into an existing hierarchy of files, potentially overwriting some of the files. The problem is that the unzip command asks for confirmation: replace ...
31
votes
3answers
12k views

Keep cmd.exe command history between sessions?

Is there a way to keep the cmd command history between sessions?
30
votes
4answers
72k views

How to open the Recycle Bin from the Windows command line?

How do I open the Recycle Bin from the command line? I'd be very glad if there is a built-in Windows command.
30
votes
3answers
14k views

Convert a PDF to greyscale on the command line in FLOSS?

I have a colour PDF file, and I'm going to print it out and then photocopy it in black and white. I'd like to know what it's like in B&W before photocopying it. Is it possible to 'greyscale' a PDF ...
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 ...