Questions tagged [command-line-interface]

A command-line interface (CLI) is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks.

A command-line interface (CLI) is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks.

1564 questions
28
votes
5 answers

How do I turn off the beep in the terminal in Linux?

I've recently started using a new desktop PC with Ubuntu Linux installed. However the terminal beeps annoyingly. i.e. If I'm at the start of the line and I press Backspace, it'll beep to tell me that there are no characters to delete. Of if I am…
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253
28
votes
6 answers

Recycle remote IIS app pool from the command line?

Is it possible to recycle an IIS7 app pool from the command line, on a different machine? I've found APPCMD (appcmd recycle apppool my-app-pool), but it only operates on the host it's run on, AFAICT. I heard a rumor there might be a way to do it…
Ken
28
votes
13 answers

Windows command prompt: how to get the count of all files in current directory?

What command would you use in cmd.exe to find the number of files in the current directory? Is there a powershell option here? Update: I was hoping to avoid dir, as I know there are 10,000+ files in the current directory. Wanted to avoid the…
27
votes
4 answers

How to display the first N lines of a command output in Windows? (the equivalent of Unix command "head")

I need an equivalent of the Unix head command (display the first N lines of the output). This is what I'm using currently: tasklist | find /N " " | findstr /r \[[0-9]\] The above code displays the first 10 lines of tasklist's output. find /N " "…
giecsar
  • 271
  • 1
  • 3
  • 3
27
votes
6 answers

Linux command to retrieve a byte range from a file

I know that head and tail can take -c option to specify a byte offset. I'm looking for a way to efficiently extract a byte range from a large log file.
Ramon
  • 657
  • 1
  • 6
  • 11
27
votes
5 answers

How can I manually run a nagios check from the command line?

When defining and testing new services in nagios I have been restarting nagios, then clicking the service, and rescheduling a check for as soon as possible, then waiting until the check happens. Is there a more efficient way to do this? I'd like to…
cwd
  • 2,763
  • 9
  • 33
  • 48
27
votes
2 answers

Can I call pushd/popd and prevent it printing the stack?

After calling pushd/popd in bash, it will print off the current directory stack. Is there any way to prevent this behaviour, so that it will act 'quitely'? This sort of noise in a command is uncommon in unix tools.
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253
26
votes
3 answers

AWS CLI Command Line: How to use "--query" to output multiple source lines

I am using aws-cli version 1.7.8 to get the --query output to create one record that is derived from multiple lines. In this case I am trying to get specific information from describe-instances. In the describe-instances command, we get lines /…
25
votes
3 answers

nslookup for SRV records (or any non-A records) in non-interactive mode

Is the anyway to run nslookup (Centos 5 or Windows) such that it will look up record types other than A, without having to go to interactive mode and using set type=? For example, I'd like a command like the following: nslookup --type=SRV…
DrStalker
  • 6,946
  • 24
  • 79
  • 107
24
votes
1 answer

How to check ElasticSearch version in Linux

I am just curious on how to check ElasticSearch version in Linux?
Aminah Nuraini
  • 1,069
  • 1
  • 8
  • 15
24
votes
6 answers

How can I tell how much RAM is installed on a FreeBSD server?

As per the title: How can I tell how much RAM is installed on a FreeBSD server? Thanks!
Ben
  • 395
  • 1
  • 4
  • 7
24
votes
3 answers

How does one escape the " ` " (accent grave/backtick) in a path?

I tend to prefix oft-used files and folders with the "accent grave" character (non-shift tilde, the back-tick, or plain-old accent, whathaveyou..), as it is easy to get at, and let's me sort things alphabetically, while letting me choose to show a…
mralexgray
  • 1,353
  • 3
  • 12
  • 29
23
votes
2 answers

backslash at the beginning of a command

In Installing RVM manual I see a lot of lines starting with '\': Install RVM with ruby: $ \curl -L https://get.rvm.io | bash -s stable --ruby I'd think it is just mistype but they repeat it many times. So what is the reason?
Putnik
  • 2,217
  • 4
  • 27
  • 43
23
votes
1 answer

How to delete scheduled task from command line without confirmation? (schtasks delete)

I can create a task from command line like this: schtasks /create /tn SomeTask /tr "do.bat arg1 arg2" /sc ONCE /st 00:00:00 /sd 01/01/1991 and now I need to delete it. However the command needs to be confirmed and I don't know how to do that from…
23
votes
9 answers

Make ls print it all on one line (like in terminal)

ls prints differently depending on whether the output is to a terminal or to something else. e.g.: $ ls . file1 file2 $ ls . | head file1 file2 Is there some way to make ls print out on one line as if it's to a terminal when it's not. There's a -C…
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253