Most Popular

1500 questions
85
votes
6 answers

Why can't Linux usernames begin with numbers?

Is there a technical reason why? Is this an artifact from the early days of Linux or Unix, and if so is there a reason why it persists?
43Tesseracts
  • 1,197
85
votes
5 answers

Can I change root's email address or forward it to an external address?

I'm getting a lot of mail in my root user's mail account. This appears to be mostly reports and errors from things like cron scripts. I'm trying to work though and solve these things, possibly even have them be piped to some sort of "dashboard" -…
cwd
  • 45,389
85
votes
1 answer

Why doesn't my systemd user unit start at boot?

I'm trying to create a systemd user unit and have it start when the system boots. The service does start manually, however it does not start at boot. From searching the Internet I learned that in order for user units to start at boot, I supposedly…
85
votes
2 answers

What do the brackets around processes mean?

$ ps -Awwo pid,comm,args PID COMMAND COMMAND 1 init /sbin/init 2 kthreadd [kthreadd] 3 ksoftirqd/0 [ksoftirqd/0] 5 kworker/u:0 [kworker/u:0] 6 migration/0 [migration/0] 7 cpuset …
joslinm
  • 971
85
votes
2 answers

Grep 'OR' regex problem

I am trying to use grep with a regex to find lines in a file that match 1 of 2 possible strings. Here is my grep: $ grep "^ID.*(ETS|FBS)" my_file.txt The above grep returns no results. However if I execute either: $ grep "^ID.*ETS" my_file.txt …
dr.bunsen
  • 1,789
85
votes
4 answers

Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment

I posted a question and noticed people weren't distinguishing correctly between many of these things: Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment. Can someone please clear this up, i.e. tell us the difference…
ptrcao
  • 5,635
85
votes
6 answers

recursive statistics on file types in directory?

I did a website scrape for a conversion project. I'd like to do some statistics on the types of files in there -- for instance, 400 .html files, 100 .gif, etc. What's an easy way to do this? It has to be recursive. Edit: With the script that…
user394
  • 14,404
  • 21
  • 67
  • 93
85
votes
2 answers

Is it better to use $(pwd) or $PWD?

I encountered BASEDIR=$(pwd) in a script. Are there any advantages or disadvantages over using BASEDIR="$PWD", other than maybe, that $PWD could be overwritten?
Minix
  • 5,855
85
votes
2 answers

When is dd suitable for copying data? (or, when are read() and write() partial)

Short version: In what circumstances is dd safe to use for copying data, safe meaning that there is no risk of corruption due to a partial read or write? Long version — preamble: dd is often used to copy data, especially from or to a device…
85
votes
5 answers

How do I start all shell sessions in a directory other than $HOME?

When I open my non-login shell in Ubuntu, my present working directory is /home/user_name (my $HOME environment variable), but I want to change this such that when I start my terminal I am in some other directory. I have read that when I start my…
85
votes
1 answer

How to list files in a zip without extra information in command line

In my bash command line, when I use unzip -l test.zip I get the output like this: Archive: test.zip Length Date Time Name --------- ---------- ----- ---- 810000 05-07-2014 15:09 file1.txt 810000 05-07-2014 15:09 …
рüффп
  • 1,707
85
votes
6 answers

Can I configure my shell to print STDERR and STDOUT in different colors?

I want to set my terminal up so stderr is printed in a different color than stdout; maybe red. This would make it easier to tell the two apart. Is there a way to configure this in .bashrc? If not, is this even possible? Note: This question was…
Naftuli Kay
  • 39,676
85
votes
6 answers

less searches are always case-insensitive

Trying to find out how to use case-insensitive searches in less I found this on serverfault. That seems to perfectly answer my question. The problem is: It doesn't work like that here (OpenSUSE 13.1; less 458). I had aliased less to less -WiNS but I…
Hauke Laging
  • 90,279
85
votes
9 answers

crontab's @reboot only works for root?

man 5 crontab is pretty clear on how to use crontab to run a script on boot: These special time specification "nicknames" are supported, which replace the 5 initial time and date fields, and are prefixed by the `@` character: @reboot : …
Withheld
  • 953
85
votes
7 answers

Allowing a regular user to listen to a port below 1024

I need to allow a non-root user to run a server listening on port tcp/80. Is there any way to do this?
peoro
  • 3,778