Questions tagged [unix]

Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.

Excerpt from the Wikipedia page

Unix was originally written in assembly but has since been rewritten in C. It has been branched many times both commercially and open source. One popular variant is the BSD variant which originated from the University of California, Berkeley. It also gave rise to Linux.

Notable variants

  • Silicon Graphics - Irix
  • IBM - AIX
  • Sun Microsystems - Solaris
  • Hewlett Packard - HP-UX

Unix is officially trademarked as UNIX.

Unix on Wikipedia

1949 questions
19
votes
3 answers

Making libmagic/file detect .docx files

As seen elsewhere, docx, xlsx and pttx are ZIPs. When uploading them to my web application, file (via libmagic andpython-magic) detects them as being ZIP. I store the contents of the file as a blob in the database, but naturally I don't want to…
Jonatan Littke
  • 371
  • 1
  • 3
  • 8
19
votes
3 answers

When should I use "nohup", and when should I use "&"?

I never know when's the best time to use nohup and the & at the end of the command.
Alex
  • 8,471
  • 26
  • 75
  • 99
19
votes
6 answers

How can I schedule a cron job that runs every 10 seconds in linux?

I know how to do every minute, but how about every 10 seconds?
Alex
  • 8,471
  • 26
  • 75
  • 99
19
votes
1 answer

Apache: Configure "LogLevel debug" for certain modules only?

I want to debug some authentication & authorization issues on my webserver, particularly with mod_authnz_ldap and other mod_auth* modules. So I set LogLevel debug in the Apache configuration, either globally or for a single VirtualHost. This…
Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186
19
votes
6 answers

Git - post-receive hook with git pull "Failed to find a valid git directory"

It's very weird but when setting a git repository and creating a post-receive hook with: echo "--initializing hook--" cd ~/websites/testing echo "--prepare update--" git pull echo "--update completed--" the hook runs indeed, but it never manage to…
zanona
  • 345
  • 2
  • 3
  • 8
18
votes
8 answers

How to get the fully qualified name (FQN) on Unix in a bash script?

I have tested hostname on several servers (RedHat, Ubuntu), and hostname -f has proven unreliable, returning sometime the short name only (as described in this question). I can see the fqn in the aliases: hostname -a (one of the aliases is the fqn I…
VonC
  • 2,683
  • 5
  • 30
  • 49
18
votes
2 answers

Why does chmod(1) on the group affect the ACL mask?

I am trying to understand this Unix behavior (which I happen to be testing on Ubuntu 11.10): $ touch foo $ setfacl -m u:nobody:rwx foo $ getfacl foo # file: foo # owner: michael # group:…
Michael Kropat
  • 859
  • 2
  • 8
  • 16
18
votes
4 answers

To fsck or not fsck after 180 days

By default after 180 days or some number of mounts, most Linux filesystems force a file system check (fsck). Of course this can be turned off using, for example, tune2fs -c 0 -i 0 on ext2 or ext3. On small filesystems, this check is merely an…
Michael Havas
  • 708
  • 1
  • 6
  • 10
17
votes
4 answers

Where should I place group shared files on a Linux system?

I'm migrating a lot of small custom scripts and data from a Linux system to another. On the old system we had a shared user that owned most of the files and they where located in that users /home, but on the new one we would rather login with our…
Daniel
  • 175
  • 1
  • 1
  • 8
17
votes
3 answers

How do you tell if a user is "allowed to log in" on Linux?

The question is simple, I want to list all the user accounts which can log in to my system, but I'm not sure if that all the users in /etc/passwd are "could login" users? Details: I can see users whose shells are set to /usr/sbin/nologin and…
harryz
  • 289
  • 2
  • 3
  • 10
17
votes
4 answers

how to export VARs from a subshell to a parent shell?

I have a Korn shell script #!/bin/ksh # set the right ENV case $INPUT in abc) export BIN=${ABC_BIN} ;; def) export BIN=${DEF_BIN} ;; *) export BIN=${BASE_BIN} ;; esac # exit 0 <- bad idea for sourcing the file now these VARs are…
webwesen
  • 945
  • 4
  • 13
  • 21
17
votes
10 answers

Easy way to get IP address from hostname using a Unix shell

What is the easiest way to get the IP address from a hostname? I was thinking about trying a ping and parse it from the output. However, that doesn't seem very nice and will probably not work the same way on all systems. I searched a bit around and…
Albert
  • 332
  • 1
  • 2
  • 12
17
votes
3 answers

What day/time does a weekly cron start on?

I had a look though the cron man but didn't find anything that helped :( Anyone know?
Mint
  • 476
  • 2
  • 9
  • 23
16
votes
4 answers

Specify default group and permissions for new files in a certain directory

I have a certain directory in which there is a project shared by multiple users. These users use SSH to gain access to this directory and modify/create files. This project should only be writeable to a certain group of users: lets call it "mygroup".…
mislav
  • 263
  • 1
  • 3
  • 7
16
votes
3 answers

Program file exists in /usr/bin, but cannot be used

Clearly my file exists in /usr/bin $ ls /usr/bin/ngrok /usr/bin/ngrok However, when I attempt to chown it I receive an error $ sudo chown my_user:users /usr/bin/ngrok chown: cannot dereference '/usr/bin/ngrok': No such file or directory Further…
Jorik
  • 177
  • 1
  • 3