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.

1557 questions
299
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…
281
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
  • 1,961
  • 7
  • 31
  • 40
193
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,833
  • 2
  • 12
  • 10
186
votes
8 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
  • 1,983
  • 2
  • 13
  • 7
180
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
  • 2,905
  • 2
  • 17
  • 13
177
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
  • 1,965
  • 2
  • 13
  • 12
164
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…
146
votes
12 answers

How do I find the UUID of a filesystem

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 filesystem label, but there doesn't seem to be a similar way to find the UUID.
Brad Gilbert
  • 2,473
  • 2
  • 21
  • 19
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
  • 2
  • 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,413
  • 13
  • 43
  • 44
134
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,535
  • 3
  • 13
  • 11
133
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
  • 1,839
  • 3
  • 13
  • 15
132
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,149
  • 4
  • 17
  • 15
130
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,801
  • 3
  • 14
  • 16
106
votes
11 answers

How to display certain lines from a text file in Linux?

I guess everyone knows the useful Linux cmd line utilities head and tail. head allows you to print the first X lines of a file, tail does the same but prints the end of the file. What is a good command to print the middle of a file? something like…
Boaz
  • 2,159
  • 5
  • 19
  • 15
1
2 3
99 100