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

learn more… | top users | synonyms

11
votes
2answers
12k views

Unix: How to merge two directories

Say I have two folders with various content, foo and bar. How can I merge bar into foo so that: Files in foo that are not in bar are untouched. Files in bar that are not in foo are now in foo. Files ...
11
votes
2answers
8k views

How to make files created in a directory owned by directory group?

Is there a way, on Linux, to cause all new files created in a directory to be owned by the directory's group instead of the creating user's group?
11
votes
2answers
2k views

Unix: Slash after directory names or not

What is the difference between the following commands? mv foo bar mv foo/ bar/ mv foo/ bar mv foo bar/ Or is there no difference? Or does it depend on the command being used? Think for example I ...
11
votes
2answers
7k views

What does the @ in ls -al mean? [duplicate]

Possible Duplicate: ls -la symbolics… what does that last symbol mean? What does the @ in the below execution of ls -al mean? atom:Lib fak$ ls -al total 1056 drwxr-xr-x 5 fak staff ...
11
votes
9answers
6k views

“Detach” and “Reattach” xterms across X sessions?

Is there a way to save/detach an xterm (or another window), and reopen/load/reattach it on a different X session on the same machine ? What I'm trying to achieve is "move" running xterms between two ...
11
votes
2answers
11k views

How long are files kept in /var/tmp/, and how to use the directory?

I'm always hesitant to use /var/tmp/, because I never quite know exactly how long the files are kept there for, or even what the directory is used for. What determines when a file gets removed from ...
11
votes
5answers
6k views

What is a “pipe” and how can it be “broken”?

I've gotten the "broken pipe" error from Xcode one time too many. I'm now curious to know exactly what a pipe is. What is the concept of a "pipe" and how can it be "broken"?
11
votes
4answers
8k views

Vim highlighting for specific file types (where to put syntax files, vim events, line to put into vimrc)

I have defined a file time jak.vim to offer custom highlighting when I take notes, however it is being applied to some files that do not have the .jak extension. Specifically a file named ...
10
votes
6answers
2k views

What is the difference between Unix and Linux? [duplicate]

I want to know what the actual difference between Unix and Linux is. Do they share the same kernel? Is Linux built on Unix? Do programs written for Linux work on Unix and vice-versa?
10
votes
3answers
9k views

What does kill -3 mean?

I know kill -9 mean, but anyone can explain what does kill -3 mean? Any special signal it sends out?
10
votes
7answers
10k views

Is it better to always copy and delete, rather than move?

Generally speaking, I find myself panicking when I realise that if I cancel a file move, it could cause the target or source to be incomplete. This question applies to Windows and Unix-based ...
10
votes
3answers
2k views

Calling a script with ./bla.sh vs. . bla.sh

Can anybody explain to me what the shell does in the two examples A) and B) below? It obviously behaves differently, but I can't find out why the output is different. Example: Let's have a script in ...
10
votes
5answers
10k views

Store the output of date and watch command to a file

I am a newbie to linux and I am trying to watch a command and try to log it into a file. I tried watch -t -n 10 "(date '+TIME:%H:%M:%S' ; ps aux | grep "pattern" | wc -l)" >> logfile and am ...
10
votes
6answers
11k views

How to delete all but one file in Unix? [duplicate]

Possible Duplicate: How to delete all files in a directory except some? How to delete all but one(or some) file in Unix? Something like rm -rf -ignore myfile.txt *
10
votes
2answers
20k views

How do I find the size of a directory on a Unix-like command-line?

I know this is a very basic question, but I searched the web and did not find a simple answer. I'm sure it's some kind of two or three letter command, right?
10
votes
8answers
3k views

Mass renaming, *nix version

I was looking for a way to rename a huge number of similarly-named files, much like this one (a Windows-related question) except that I'm using *nix (Ubuntu and FreeBSD, separately). Just to sum up, ...
10
votes
3answers
18k views

How to copy a file in unix without altering its last modified time?

If I copy some file from some place to another using cp, the timestamp on the copied file is set to the time of the copy. Is there some way to avoid this? I need to copy files without altering their ...
10
votes
5answers
4k views

What is the official installer for Unix packages on Mac OS?

I'm a bit confused about the installation of standard Unix packages on Mac OS X. For example, I have /usr/bin/svn, which is SVN v.1.4.4, but FinkCommander says svn is not installed. The same holds for ...
10
votes
3answers
15k views

How can I use ssh to run a command on a remote Unix machine and exit before the command completes?

How can I use ssh to run a command on a Unix machine and exit before the command completes? For instance, if I type ssh localhost 'sleep 60 &' ssh hangs on my terminal until sleep completes, ...
10
votes
3answers
35k views

Copy Folders from one Unix server to another?

I would like to copy a folder from one Unix server to another Unix server. Can anyone tell me if there is a method or command to to achieve this?
10
votes
2answers
9k views

Understanding top command in unix

When I run top -c command on my UNIX box I get the output below: top - 03:09:34 up 5 days, 6:14, 1 user, load average: 0.00, 0.00, 0.00 Tasks: 175 total, 1 running, 174 sleeping, 0 stopped, ...
10
votes
3answers
5k views

SSH: completly disabling password authentication

is there a way to disable password authentication completely? The command line is the following: ssh -o KbdInteractiveAuthentication=no -o PasswordAuthentication=no machine" it STILL asks for a ...
10
votes
2answers
21k views

Subsystem for UNIX-based Applications in Windows 7

Noticed a thing called Subsystem for UNIX-based Applications in the Turn Windows features on and off dialog under Windows 7. Never seen it before, and it seems interesting. What exactly is it really? ...
10
votes
1answer
23k views

What does directory permission 'S' mean? (not lower case, but in upper case)

I downloaded Eclipse, uncompressed it, did a few other things and all sudden I notice this interesting behaviour: ^_^ ~/Downloads > sudo chmod 0000 eclipse/ ^_^ ~/Downloads > stat eclipse/ ...
10
votes
3answers
2k views

Why are there short and long alternatives for command line options?

Most unixoid commands feature short and long alternatives for command line options, like ls -a and ls --all, or ls -A and ls --almost-all. Why do those two ways exist? One is shorter to type, the ...
10
votes
4answers
8k views

removing write permission does not prevent root from writing to the file

I just noticed on my Ubuntu machine (ext3 filesystem) that removing write permissions from a file does not keep root from writing to it. Is this a general rule of UNIX file permissions? Or specific ...
10
votes
3answers
5k views

How Many Unix Groups Can A User Be A Member Of?

We've recently run into a situation at a group-happy site where some group memberships are not being picked up. I seem to remember that there is an upper limit to the number of groups that a user can ...
10
votes
2answers
24k views

How can I check the user command history in Unix?

I know the 'history' command give me a list of the commands I have typed into the Unix terminal. How do I see the command history for all of the users currently logged onto the system?
10
votes
2answers
3k views

Linux-like top/netstat/etc. on Mac OS X?

Unix utilities on Mac OS X are quite painful to use. port install coreutils +with_default_names and a few other such replacements fix most of them, but it leaves some in broken Mac OS X defaults - ...
10
votes
2answers
281 views

How to move folder in unix using mv, only when target is on the same drive

I need to move a folder using unix mv command, but only if the target is in the same drive or the same filesystem. What would be the best approach?
10
votes
4answers
9k views

How do I set an environmental variable for a GNOME session?

On my system, for apps that use SDL, I need to set an environmental variable: export SDL_AUDIODRIVER=alsa to get the sound to work properly. How do I set up my GNOME session so that this variable ...
10
votes
2answers
117 views

vi / vim abrumpt buffer movements within window

When using :set wrap in vi/vim, the contents of an entire wrapped line are placed in the display buffer upon moving the cursor into a new line, even when navigating through a file by display line ...
9
votes
11answers
3k views

Unix: How can I allow only one person to see my folder in the same fs?

I want to give an access to a dir for a friend. He has the access to the file system, where the dir is located. I don't want to set the permissions to all users. How can I allow only a person to see ...
9
votes
9answers
7k views

grep all .java files in a directory for a particular string

How would I search all .java files for a simple string (not a regex) in the current directory and all sub-directories on Mac OS X? I just want to print a list of file and directory names that match.
9
votes
3answers
4k views

How to read Unix usage

I did some searching, but I cannot find documentation on how Unix usage works. I know something (mostly through trial and error) but, for example, how do I know that /usr/bin/ls ...
9
votes
4answers
771 views

Unix tools: what if a file is named minus something?

I'm always wondering: most GNU/Unix tools take options in the form "minus something", sometimes followed by an argument. What if you got a file named minus something? $ ls -f $ rm -f $ ls -f $ mv -f ...
9
votes
5answers
4k views

How is \$ being interpreted by grep?

When I write $ grep \$ then whatever I type on terminal, is matched and printed on terminal. How is \$ being interpreted?
9
votes
2answers
6k views

How can I found out if file is alias or symbolic link?

I'm working on a legacy system and I have a bunch of files that are referencing images that are located in other folders. lrwxrwxrwx 1 user nobody 56 Feb 10 2010 t100x100.jpg -> ...
9
votes
5answers
6k views

bash execution time in milliseconds (mac osx user)

I've checked this , but the solution provided did not work for me. Using date I can get the execution time in seconds: T="$(date +%s)" #some work here T="$(($(date +%s)-T))" echo "execution time ...
9
votes
1answer
13k views

How do I clear out the ssh-agent entries (on Mac OS X )?

I'm running Mac OS X, and it appears that after SSHing to several machines, using identity files, my 'ssh-agent' builds up a lot of identity / keys and then sometimes offers too many to a ...
9
votes
3answers
4k views

Is it possible to mount a .tar file?

The only result of any import when I searched for this was from 2001. In the intervening decade, have any tools/methods for mounting a tar file as a filesystem (perhaps utilizing fuse) been created? ...
9
votes
4answers
5k views

Is there a way to edit files inside of a zip file without explicitly extracting them first?

I sometimes need to make changes to a .zip or .jar file, so I usually move the file to /tmp, extract all the files with unzip, edit a few files, and then re-zip up the files. This works, but it can ...
9
votes
2answers
7k views

Finding all symbolic and hard links to a file on UNIX

If I have a specific file in a UNIX filesystem, is there a way to use bash to find all links to that file, both symbolic and hard? If I need different commands for each, what are they?
9
votes
1answer
1k views

Let tmux set urxvt window title according to session-name

Everyday I launch a bunch of urxvtc -e tmux. I am trying to find a way to override urxvt X window title ("tmux") with the current tmux session name set via :rename-session session_name. Does any ...
9
votes
1answer
4k views

PowerShell vs. the Unix Shell

I've heard some things about the features of the PowerShell. Some of it seems like typical features of Unix shells. So it seems Powershell includes piping and the commandlets, similar to shell ...
9
votes
2answers
4k views

Printing pages from 7 to 17 by lpr

How can you print pages from 7 to 17 by lpr?
9
votes
1answer
13k views

Console commands to change virtual ttys in Linux and OpenBSD

In Linux one presses Alt-F1, Alt-F2 etc to change virtual ttys. In OpenBSD one shall use Ctrl-Alt-F1 etc instead. My question is if there are console commands for these two operating systems that ...
9
votes
1answer
3k views

Linux - alternative places where to store pid file instead of /var/run

As written in the title, where should I let the init script write the pid file? are there any standard paths I should choose instead of the /var/run ? Could /tmp be a good place where to store it or ...
9
votes
2answers
3k views

Practical tips when transitioning to xmonad?

I like the idea and concept of xmonad, however I still keep going back to gnome after an hour or so. This feels like when I first tried to learn vim, but I've gotten past the learning curve point and ...
9
votes
5answers
1k views

Export NFS path containing “-” (dash)

I'm in a bit of a pinch with NFS exports file. Specifically, I can't find a way to export a directory containing "-" in the path name. Manual (exports(5)) states: Also, each line may have one or ...