How to find union of two files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to find union of two files
# 8  
Old 12-07-2005
Thanks pixelbeat!
That's what I was looking for. The "-u" option for uniq.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies

2. Programming

Event driven programming / epoll / typedef union / session data array

Sorry for the “word salad” subject, but I wanted to cast a wide net for help. I've created an IP (Internet Protocol) server which serves HTTP, SMTP, and FTP requests. As you probably know, they all require creating a socket, listening on it, accepting connections, and then having a short... (3 Replies)
Discussion started by: John S.
3 Replies

3. Programming

GDB and GCC union

My concept may sound a bit cryptic but I what some startup information as to how we can use GDB APIs / debugging techniques in programs with GCC when we compile the program. We can definitely tell gcc to link GDB libs also. The ultimate aid would be that when the compiled programs executes it... (4 Replies)
Discussion started by: uunniixx
4 Replies

4. Web Development

Intersection and union of array by hash

Hi, A piece of script from Perl-cookbook I do not understand, and post here for explanation. The purpose is to find the element in either array (union), and in both array (intersection). Thank you in advance. @a=qw(1 3 5 6 7 8); @b=qw(2 3 5 7 9); foreach $e (@a, @b) {$union{$e}++ &&... (3 Replies)
Discussion started by: yifangt
3 Replies

5. Shell Programming and Scripting

awk: union regions

Hi all, I have difficulty to solve the followign problem. mydata: StartPoint EndPoint 22 55 2222 2230 33 66 44 58 222 240 11 25 22 60 33 45 The union of above... (2 Replies)
Discussion started by: phoeberunner
2 Replies

6. Shell Programming and Scripting

Text files union

How can i union two files that each of them contain text to one new file in unix shell scripting or in awk scripting language? (2 Replies)
Discussion started by: tal
2 Replies

7. Shell Programming and Scripting

union of two files

Given two files of the same format (For example number1|text1|number2) what is the command to print lines in file1 which do not occur in file2? diff command seems a bit complicated for me for this purpose. Please help!! Thank you very much. (3 Replies)
Discussion started by: sherkaner
3 Replies

8. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

9. Shell Programming and Scripting

Find files older than 20 days & not use find

I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in. How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies
Login or Register to Ask a Question
MOUNT_UNION(8)						    BSD System Manager's Manual 					    MOUNT_UNION(8)

NAME
mount_union -- mount union filesystems SYNOPSIS
mount_union [-b] [-o options] directory uniondir DESCRIPTION
The mount_union command attaches directory above uniondir in such a way that the contents of both directory trees remain visible. By default, directory becomes the upper layer and uniondir becomes the lower layer. Both directory and uniondir are converted to absolute paths before use. The options are as follows: -b Invert the default position, so that directory becomes the lower layer and uniondir becomes the upper layer. However, uniondir remains the mount point. -o Options are specified with a -o flag followed by a comma separated string of options. See the mount(8) man page for possible options and their meanings. Filenames are looked up in the upper layer and then in the lower layer. If a directory is found in the lower layer, and there is no entry in the upper layer, then a shadow directory will be created in the upper layer. It will be owned by the user who originally did the union mount, with mode "rwxrwxrwx" (0777) modified by the umask in effect at that time. If a file exists in the upper layer then there is no way to access a file with the same name in the lower layer. If necessary, a combination of loopback and union mounts can be made which will still allow the lower files to be accessed by a different pathname. Except in the case of a directory, access to an object is granted via the normal filesystem access checks. For directories, the current user must have access to both the upper and lower directories (should they both exist). Requests to create or modify objects in uniondir are passed to the upper layer with the exception of a few special cases. An attempt to open for writing a file which exists in the lower layer causes a copy of the entire file to be made to the upper layer, and then for the upper layer copy to be opened. Similarly, an attempt to truncate a lower layer file to zero length causes an empty file to be created in the upper layer. Any other operation which would ultimately require modification to the lower layer fails with EROFS. The union filesystem manipulates the namespace, rather than individual filesystems. The union operation applies recursively down the direc- tory tree now rooted at uniondir. Thus any filesystems which are mounted under uniondir will take part in the union operation. This differs from the union option to mount(8) which only applies the union operation to the mount point itself, and then only for lookups. EXAMPLES
The commands mount -t cd9660 -o ro /dev/cd0a /usr/src mount -t union /var/obj /usr/src mount the CD-ROM drive /dev/cd0a on /usr/src and then attaches /var/obj on top. For most purposes the effect of this is to make the source tree appear writable even though it is stored on a CD-ROM. The command mount -t union -o -b /sys $HOME/sys attaches the system source tree below the sys directory in the user's home directory. This allows individual users to make private changes to the source, and build new kernels, without those changes becoming visible to other users. Note that the files in the lower layer remain accessible via /sys. SEE ALSO
intro(2), mount(2), unmount(2), fstab(5), fsck_ffs(8), mount(8), mount_null(8), sysctl(8) HISTORY
The mount_union command first appeared in 4.4BSD. BUGS
Without whiteout support from the filesystem backing the upper layer, there is no way that delete and rename operations on lower layer objects can be done. An attempt to mount a union directory under one which does not have whiteout support will return EOPNOTSUPP ("Operation not supported"). Whiteout support can be added to an existing FFS filesystem by using the -c option of fsck_ffs(8). Running find(1) over a union tree has the side-effect of creating a tree of shadow directories in the upper layer. BSD
February 5, 2008 BSD