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.

1575 questions
35
votes
81 answers

Biggest command-line mistake?

What is the most damage (of whatever kind) that you have ever caused with a single mistaken/mistyped/misguided command line? I deleted a production system database by mistake a while back, for example, but I was lucky (i.e. backed-up) and there was…
13
votes
3 answers

Why `wc -c` always count 1 more character?

in tmp I type a single character,but wc -c shows 2,why?
linux
  • 1,263
  • 4
  • 13
  • 15
5
votes
2 answers

Better alternatives to common command line tools?

I've recently found some awesome replacements for common command line tools and wanted to share them and learn about others. The three of these have made my recent troubleshooting much more efficient: ack - ack is a tool like grep, designed for…
powdahound
  • 4,385
4
votes
6 answers

How to delete file with option character in name in Linux?

I've got a file called -T on my linux box, and, I thought I could do rm "-T" or rm "\-T" or rm \-T or rm *T Alas, I've run out of simple tricks (or I'm misuing them). I keep getting the error message: rm: invalid option -- T I'm pretty…
cgp
  • 1,042
4
votes
4 answers

Can I use a flag like -l from ls with find or locate?

Is there a way to display all the information that -l does in ls (permissions, dates, etc.) when using the locate or find commands?
4
votes
2 answers

In PHP how can I detect code is being run from command line?

When I run my PHP script from the command line I get the following notices. I assume the reason is that these variables such SERVER_NAME are not applicable when running without a browser. In my code how can I detect that it is run from command line…
davidjhp
  • 700
4
votes
2 answers

What are the differences between "less" and "more"?

As I understand it, less is more + the ability to scroll up. Is it correct? Is there any reason to use more instead of less? Are there any significant differences I'm missing out?
3
votes
2 answers

Linux how to force an external ping from eth0 to eth1 without a router

i am trying to have eth0 connected to eth1 on the same machine with a loopback cable. I have eth0 as 2.2.2.1 and eth1 as 2.2.2.2 with netmask 255.255.255.0 and the right Bcast 2.2.2.255 . I tried to ping -I eth0 2.2.2.2 and ping -I eth1 2.2.2.1. My…
Elie
  • 31
2
votes
1 answer

Alternative to "sort | uniq -c | sort -n"

I've been doing | sort | uniq -c | sort -n for years! Just wondering if somewhere buried in the command stack that people have been updating for years if there is a simple alternative.
koblas
  • 155
2
votes
1 answer

what does the command `set autolist` do?

Any idea what the autolist argument means? I could'nt find anything about it in the manual.
RonK
  • 241
1
vote
2 answers

Script return summary of exit codes

I use this command for test my html pages for errors: find . -iname '*html' -type f -print -exec /usr/local/bin/tidy -q -e {} \; And I want to get exit code > 0 if any errors was founded by tidy. find always return me 0. Is there any way to sums…
1
vote
1 answer

Simplest way to output file ages instead of filedates by ls?

What is the simplest way to output file ages instead of filedates by ls command? Like "1 hour", "2 days", "3 weeks", etc. (Sometimes file age is much more significant than date)
user60133
1
vote
1 answer

Cut last 500 lines from logfile

I want to cut the last 500 lines from a logfile and save it to a new file. Is there any unix command for this?
1
vote
3 answers

move exited with code 1

Does anybody know what causes the "move" command in the windows shell to exit with code 1 ? Any error messages I've been able to find by Googling around are very vague, saying just "invalid function". The cause of this is trying to use the "move"…
1
vote
1 answer

Command Prompt - see who is on network

Using Command Prompt... can you see all of the users who are logged on a network?
test
  • 167
1
2