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
306
votes
14 answers

What's the command-line utility in Windows to do a reverse DNS look-up?

Is there a built-in command line tool that will do reverse DNS look-ups in Windows? I.e., something like w.x.y.z => mycomputername I've tried: nslookup: seems to be forward look-up only. host: doesn't exist dig: also doesn't exist. I…
280
votes
160 answers

Useful Command-line Commands on Windows

The aim for this Wiki is to promote using a command to open up commonly used applications without having to go through many mouse clicks - thus saving time on monitoring and troubleshooting Windows machines. Answer entries need to…
dance2die
  • 2,011
  • 7
  • 32
  • 41
196
votes
6 answers

How to cd into a directory with this name "-2" (starting with the hyphen)?

I have a directory named: -2 I want to cd into it but the cd complains: bash: cd: -2: invalid option With no success, I've tried: cd "-2" cd '-2' cd \-2 Any solution? Edit: no file browsers like mc, etc. available on the server.
user151851
  • 1,863
  • 2
  • 12
  • 10
191
votes
10 answers

Nginx enable site command

We all know how to enable a website using apache on Linux. I'm pretty sure that we all agree on using the a2ensite command. Unfortunately, there is no default equivalent command that comes with Nginx, but it did happen that I installed some package…
HXH
  • 3,045
  • 2
  • 18
  • 13
189
votes
9 answers

Resolve host name from IP address

I'm looking for a command line tool which gets an IP address and returns the host name, for Windows.
DouglasJose
  • 2,013
  • 2
  • 14
  • 7
182
votes
31 answers

How do I prevent accidental rm -rf /*?

I just ran rm -rf /* accidentally, but I meant rm -rf ./* (notice the star after the slash). alias rm='rm -i' and --preserve-root by default didn't save me, so are there any automatic safeguards for this? I wasn't root and cancelled the command…
Valentin Nemcev
  • 2,015
  • 2
  • 14
  • 12
168
votes
11 answers

Run a .bat file in a scheduled task without a window

I have a scheduled task that starts a batch script that runs robocopy every hour. Every time it runs a window pops up on the desktop with robocopy's output, which I don't really want to see. I managed to make the window appear minimized by making…
152
votes
9 answers

How to remove empty/blank lines from a file in Unix (including spaces)?

How do I remove empty/blank (including spaces only) lines in a file in Unix/Linux using the command line? contents of file.txt Line:Text 1: 2:AAA 3: 4:BBB 5: 6:CCC 7: 8:DDD output desired…
Michael Ellick Ang
  • 2,039
  • 3
  • 14
  • 15
149
votes
13 answers

How do I find the UUID of a file system?

I'm running Ubuntu, and want to find out the UUID of a particular filesystem (not partition). I know I can use e2label /dev/sda1 to find out the file system label, but there doesn't seem to be a similar way to find the UUID.
Brad Gilbert
  • 2,503
  • 2
  • 21
  • 19
146
votes
6 answers

Show full process name in top

I'm running a Rails stack on Ubuntu. When I call ps -AF, I get a descriptive process name set by the Apache module like 00:00:43 Rails: /var/www... which is really helpful in diagnosing load issues. But when I call top, the same process shows up…
Ben K.
  • 2,379
  • 4
  • 18
  • 15
143
votes
9 answers

Find out symbolic link target via command line

Say that I setup a symbolic link: ln -s /root/Public/mytextfile.txt /root/Public/myothertextfile.txt is there a way to see what the target of myothertextfile.txt is using the command line?
Jared
  • 1,577
  • 3
  • 12
  • 12
141
votes
39 answers

What useful things can one add to one's .bashrc?

Is there anything that you can't live without and will make my life SO much easier? Here are some that I use ('diskspace' & 'folders' are particularly handy). # some more ls aliases alias ll='ls -alh' alias la='ls -A' alias l='ls -CFlh' alias…
Gareth
  • 8,573
  • 13
  • 44
  • 44
140
votes
11 answers

Run Oracle SQL script and exit from sqlplus.exe via command prompt

I would like to run an Oracle script through SQL Plus via a Windows command prompt. The script does not contain an "exit" command, but I would still like SQL Plus to exit, returning control to the command prompt on completion of the script. My goal…
JoshL
  • 1,595
  • 3
  • 13
  • 11
132
votes
7 answers

Does Windows have a built-in ZIP command for the command line?

Since Windows Explorer (since at least Windows XP) has some basic support for ZIP files, it seems like there should be a command-line equivalent, but I can't seem to find any sign of one. Does Windows (XP, Vista, 7, 8, 2003, 2008, 2013) ship with a…
Electrons_Ahoy
  • 1,821
  • 3
  • 15
  • 16
118
votes
14 answers

What's the reverse DNS command line utility?

What's the command to find the name of a computer given its IP address? I always forget what this command is, but I know it exists in Windows and I assume it exists on the *nix command-line.
1
2 3
99 100