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)

64
votes
12answers
72k views

How to start GUI linux programs from the command line, but separate from the command line?

I've searched for this before, but have never been able to find an answer. In Windows, if I have a console window open, type winmine, and press enter, Minesweeper will appear, completely separate ...
64
votes
5answers
204k 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.
64
votes
8answers
56k 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.
61
votes
7answers
155k 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?
59
votes
8answers
39k 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.
58
votes
9answers
27k views

Is it possible to run Windows without GUI?

I'm just wondering if it is possible to run Windows without its GUI like Linux—with just the virtual terminal (tty) The reason behind this is that my Windows 7 box often freezes whenever some ...
58
votes
9answers
86k views

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

What's the command line utility and the arguments it requires?
58
votes
9answers
21k 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 ...
57
votes
9answers
156k views

How can I execute a Windows command line in background?

How can I execute a windows command line in the background, without it interacting with the active user?
56
votes
1answer
1k views

How is a program that's not in my path being run? [duplicate]

Possible Duplicate: Why am I able to execute a program that is not in my PATH environment variable? I was teaching a coworker about %PATH% and found that if I run "Firefox", it works, but ...
56
votes
5answers
165k views

How can I direct a query to specific DNS server?

I would like to issue a query to a specific DNS server, whose IP address I know. It doesn't really matter if it's on Windows or *nix. In Windows I can do something like: C:\Documents and ...
54
votes
9answers
164k 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 ...
54
votes
17answers
222k 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 ...
54
votes
6answers
98k 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 ...
53
votes
11answers
29k 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 ...
53
votes
7answers
81k 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 ...
52
votes
4answers
182k 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 ...
51
votes
4answers
64k 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 ...
51
votes
3answers
134k views

Clear windows command prompt screen using keyboard shortcuts

Is there any way of clearing the command prompt screen in windows using keyboard shortcuts?
50
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 ...
50
votes
5answers
72k views

List the current folder folder's sizes with the terminal?

I want a list of the folders from the current directory or one that I specify with their size. I have tried with du but I only get the size of the directories I specify (du . ./f1), and ls doesn't ...
50
votes
3answers
94k 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 ...
50
votes
2answers
79k 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 ...
49
votes
4answers
31k views

Mac OS X “say” command in Ubuntu?

Is there an equivalent to the Mac's terminal command "say" in Ubuntu 9.10?
49
votes
2answers
9k 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 ...
48
votes
10answers
62k views

Is there a shortcut command in Windows command prompt to get to the current user's 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 ...
48
votes
4answers
118k 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 $?
47
votes
5answers
196k views

How can I find out when Windows was last restarted?

How can I know when my computer running Windows 7 was last restarted? I prefer a solution that doesn't involve searching the event log, but something like wmic or maybe cmd commands.
47
votes
4answers
70k 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 ...
47
votes
5answers
58k 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 ...
47
votes
9answers
96k 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.
46
votes
5answers
9k 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 ...
46
votes
7answers
124k 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.
46
votes
5answers
42k views

How do I close the Terminal in OSX from the command line?

Why doesn't "exit" close a Terminal.app window on Mac OS X? $ exit logout [Process completed] Is there a way to close the window without using the mouse?
46
votes
6answers
120k 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 ...
46
votes
3answers
68k 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. ...
46
votes
3answers
87k views

How to echo contents of file in a DOS/Windows command prompt [duplicate]

Possible Duplicate: How can I print a textfile on the command prompt in Windows? Like in Unix' cat filename ... Can this be done?
45
votes
5answers
114k 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 ...
45
votes
9answers
127k 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 ...
45
votes
7answers
77k 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 )
45
votes
9answers
88k views

How to get parent PID of a given process in GNU/Linux from command line?

Resolved before asked: cat /proc/1111/status | grep PPid
45
votes
5answers
125k 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: ...
44
votes
3answers
20k 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 ...
44
votes
5answers
178k views

See available drives from Windows CLI?

Is there a way to list the available drives from cmd.exe ? (Other than manually typying c: d: ... and seeing which ones return errors)
44
votes
9answers
127k 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?
42
votes
3answers
75k 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 ...
42
votes
14answers
43k views

Is there a way to display a countdown or stopwatch timer in a terminal?

How can I display a real-time countdown timer on the Linux terminal? Is there an existing app or, even better, a one liner to do this?
42
votes
2answers
7k 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 ...
42
votes
6answers
49k 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 ...
42
votes
7answers
39k 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 ...