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)

224
votes
10answers
167k 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 ...
195
votes
6answers
126k views

How to chmod 755 all directories but no file (recursively)?

How to chmod 755 all directories but no file (recursively) ? Inversely, how to chmod only files (recursively) but no directory ?
163
votes
4answers
365k views

How to find a directory on linux?

I have a VPS with Suse Linux 10.3. I've logged in via SSH/putty and am trying to find where my web files are located. Since I'm uploading via FTP in a directory called httpdocs, I assume that this ...
154
votes
8answers
9k 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.
148
votes
5answers
86k views

How to open files in vertically/horizontal split windows in Vim from the command line

There must be a way, something like this: vim -[option] <file-list> to open files from command prompt and not from within Vim. split windows vertically or/and horizontally in separate tabs ...
132
votes
4answers
30k views

How to turn off word-wrap in less

Short version: How can I make the less utility in Linux not wrap lines? Long version: Often I need to view huge CSV files using less with hundreds of columns. I frequently only care about the first ...
130
votes
9answers
14k views

I accidentally typed password into bash command line

I accidentally typed my password into bash command line, mistaking the Last login: ... line for Wrong password (I was in a hurry). What do I do to cover my trace? What I did was editing .bash_history ...
106
votes
8answers
118k views

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

I type echo $PATH on the command line and get ...
103
votes
18answers
8k views

What's the quickest way to count the number of each character in a file?

I want to count the A's T's C's G's N's and "-" characters in a file, or every letter if needed, is there a quick Unix command to do this?
101
votes
2answers
77k views

Go back to previous directory in shell

Is there a way to go back to previous directory we were in using bash,tcsh without using pushd/popd ? I'd like to type something like "back" and got returned to the previous directory I was in. Edit: ...
99
votes
5answers
216k views

How can I display the contents of an environment variable from the command prompt in Windows 7?

In Windows 7, when I start the Command prompt, is there any command to display the contents of an environment variable (such as the JAVA_HOME or PATH variables)? I have tried with echo $PATH, echo ...
94
votes
2answers
83k views

How to add user to a group from Mac OS X command line?

trying to add a user to a group from the command line but can't figure out how? Specifically this is on Mac OS X Server 10.5.8 like to add user to 'admin' and 'wheel' groups
90
votes
6answers
67k views

What's different between Ctrl+Z and Ctrl+C in Unix command line?

I'm using Mac OS X Terminal. And I use Ctrl+Z or Ctrl+C to stop some programs. But I realized that I don't know what they're exactly doing. What are they and what's the difference between them? ...
85
votes
7answers
12k views

How can I create a file with a specific size from a command line?

How can I create a file (e.g. using the touch command or another similar way), but with a specific size (e.g. 14 MB)? The use case is to test FTP with various file sizes. If we can create a file with ...
84
votes
6answers
115k 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?
77
votes
5answers
136k views

How to recursively delete directory from command line in windows?

Is there a windows equivalent of sudo rm -r [directory-name]?
74
votes
12answers
45k views

How to get information about an image(picture) from linux commandline?

Am working on a web-app, and currently am migrating some stuff from an old app, but I hate that I have to open an image editor to get some info about images am migrating. Things like image dimensions. ...
73
votes
5answers
972k views

How do I locate the MAC address of my computer?

I am unable to locate the MAC address in a new computer with Windows 7. I've tried ipconfig /all in the console to which I got no items match your search. I also tried getmac. A screen flashed very ...
70
votes
7answers
22k 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.
67
votes
2answers
14k views

How to append to a file as sudo? [duplicate]

Possible Duplicate: sudo unable to write to /etc/profile I want to do: echo "something" >> /etc/config_file But, since only the root user has write permission to this file, I can't ...
65
votes
6answers
4k views

How do I perform commands in another folder, without repeating the folder path?

Is there a clever way to do copy and move operations or a command to duplicate a file, without having to do a cd, then mv after, at the same folder? For example, I have to run the following: mv ...
64
votes
5answers
6k views

How can I permanently customize the Command Prompt in Windows 7?

I would like to change the prompt to $p$g$_$f permanently, but it resets itself every time I reopen the command window. How can I get it to stay the same forever for eternity?
64
votes
10answers
39k views

Is it possible to `tail -f` the output of `dmesg`?

Want to do something like dmesg | tail -f but it doesn't work: I use Mac OSX 10.6.7, by doing that the tail will exit, instead of monitoring the output. I wonder if there is any way to do it, or ...
63
votes
8answers
172k views

Can you zip a file from the command prompt using ONLY Windows' built-in capability to zip files?

I have a batch file that outputs a text file. I thought it would be nice if I could zip it up too. This will be used in an uncontrolled environment, so I can't make assumptions about the presence of ...
61
votes
4answers
17k 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 ...
59
votes
12answers
30k views

How to supress “Terminate batch job (Y/N)” confirmation?

In cmd, when we press Ctrl+C we get the target application terminated but if the target application is called from a batch file, we get this "Terminate batch job (Y/N)" confirmation. I can never ...
58
votes
13answers
131k 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 ...
57
votes
9answers
30k 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?
56
votes
6answers
91k views

How to copy symbolic links?

I have directory that contains some symbolic links: user@host:include$ find .. -type l -ls 4737414 0 lrwxrwxrwx 1 user group 13 Dec 9 13:47 ../k0607-lsi6/camac -> ../../include 4737415 ...
56
votes
9answers
145k 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 ...
55
votes
5answers
46k views

Recursively count all the files in a directory [duplicate]

Possible Duplicate: How can I count the number of folders in a drive using Linux? I have a really deep directory tree on my Linux box. I would like to count all of the files in that path, ...
55
votes
6answers
84k 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.
54
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 ...
53
votes
9answers
59k views

How to clear the contents of a file from the command line?

I have a log file that has a bunch of stuff in it that I don't need anymore. I want to clear the contents. I know how to print the contents to the screen: cat file.log I know how to edit the file, ...
53
votes
4answers
15k 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 ...
52
votes
7answers
108k 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 ...
52
votes
5answers
62k 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 ...
50
votes
7answers
16k 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 ...
50
votes
9answers
117k views

How to run a batch file without launching a “command window”?

On Windows XP, can I run a batch (.bat or .cmd) file, via a shortcut, without a "black window"?
49
votes
6answers
138k views

ls-command: how to display the file size in megabytes?

In Unix (Tru64), how do I make the ls command show the file size in megabytes? Currently I am able to show it in bytes using the following: ls -la
49
votes
3answers
51k views

How to find out Mac OS X version from Terminal?

I know how to find Mac OS X version from GUI: Apple Menu (top left) > About This Mac Is there a Terminal command that will tell me Mac OS X version?
48
votes
14answers
66k 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 ...
48
votes
5answers
100k 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?
48
votes
2answers
42k views

7Zip - Command Line : Exclude folder(s) by wildcard pattern?

Any idea how to exclude a wild-carded path(s) from a command-line 7zip command? I'm doing something this: 7z.exe a -t7z archive.7z FolderToArchive\ -mx0 and would like to exclude any \bin\*.* or ...
47
votes
21answers
90k 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 ...
46
votes
9answers
120k 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 ...
46
votes
12answers
52k 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 ...
45
votes
7answers
41k 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 ...
45
votes
3answers
48k views

How to find the executable files under a certain directory in linux?

How to find the executable files under a certain directory in linux?
44
votes
2answers
7k views

Case insensitive tab completion in Bash

Is there any way to make Bash tab complete case insensitively? $ bash --version GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0) Copyright (C) 2007 Free Software Foundation, Inc. I am ...