diff two files and output lines not seen in file 2

Problem

You need two diff two files and only output what is unique to file one.

text file 1 contains:

1 2 3 4 5

text file 2 contains:

6 7 1 2 3 4 Solution $ awk ‘FNR==NR{a[$0]++;next}!a[$0]‘ file1 file2 6 7

Explanation of how the code works:

If we’re working on file1, track . . . → Read More: diff two files and output lines not seen in file 2

Red Hat Linux cheat sheet commands examples RHEL

Useful Linux Commands (Red Hat)

(http://www.cse.buffalo.edu/~eisner/DLW) Revised 3/1/2000

Getting information man commandname display the manual page for a particular command named commandname man -S sectionnumber commandname display the manual page under a specific section numbered sectionnumber for the command named commandname. Sometimes the same command will exist in more than one section. man alone will . . . → Read More: Red Hat Linux cheat sheet commands examples RHEL

Linux find large files

How do you find large files or directories on your disk in freebsd, unix, linux ? Linux find large files examples; find large files on your disk in *nix.

All *nix systems List total size of each directory/file at current path level du -sk * | sort -rn | head

Example output:

[root@centos6 /]# du . . . → Read More: Linux find large files