readelf – Displays information about ELF files

commandline session

$readelf  -I /bin/ping

Histogram for `.gnu.hash' bucket list length (total of 3 buckets):
 Length  Number     % of total  Coverage
      0  0          (  0.0%)
      1  0          (  0.0%)      0.0%
      2  0          (  0.0%)      0.0%
      3  3          (100.0%)    100.0%
$readelf  -a /bin/ping | head
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
$readelf  -a /bin/ping | head -n 20
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x402ac0
  Start of program headers:          64 (bytes into file)
  Start of section headers:          38200 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         9
  Size of section headers:           64 (bytes)
  Number of section headers:         27
  Section header string table index: 26
$

hexdump, hd — ASCII, decimal, hexadecimal, octal dump

commandline session

$echo a > hex.txt
$hexdump hex.txt
0000000 0a61
0000002
$
$echo b  > hex.txt
$hexdump hex.txt
0000000 0a62
0000002
$echo ab  > hex.txt
$
$hexdump hex.txt
0000000 6261 000a
0000003
$echo > hex.txt
$hexdump hex.txt
0000000 000a
0000001
$echo abc > hex.txt
$hexdump hex.txt
0000000 6261 0a63
0000004
$

free – it displays buffers used by the kernel

root>free -l -s 3
             total       used       free     shared    buffers     cached
Mem:       1995396    1832704     162692          0     246952     500216
Low:       1995396    1832704     162692
High:            0          0          0
-/+ buffers/cache:    1085536     909860
Swap:      5843964       7456    58310008

             total       used       free     shared    buffers     cached
Mem:       1995396    1832616     162780          0     246952     500216
Low:       1995396    1832704     162692
High:            0          0          0
-/+ buffers/cache:    1085448     909948
Swap:      5843964       7456    58310008

             total       used       free     shared    buffers     cached
Mem:       1995396    1832560     162836          0     246960     500220
Low:       1995396    1832704     162692
High:            0          0          0
-/+ buffers/cache:    1085380     910016
Swap:      5843964       7456    58310008

             total       used       free     shared    buffers     cached
Mem:       1995396    1832576     162820          0     246968     500220
Low:       1995396    1832704     162692
High:            0          0          0
-/+ buffers/cache:    1085388     910008
Swap:      5843964       7456    58310008

^C
root>

flock – manage locks from shell scripts

commandline session

$> 1
$flock 1
$ls
1
$echo 1 > 1
$cat 1
1
$ls -l
total 4
-rw-r--r-- 1 jeffrin jeffrin 2 Aug 11 18:24 1
$flock -n 1
$echo 1 > 1
$ls -l
total 4
-rw-r--r-- 1 jeffrin jeffrin 2 Aug 11 18:29 1
$1 /var/loc
local/ lock/
$1> /var/lock/mylock
$cat 1
1
$rm 1
$ls
$ls -l /var/lock/mylock
-rw-r--r-- 1 jeffrin jeffrin 0 Aug 11 18:30 /var/lock/mylock
$rm /var/lock/mylock
$ls
$1> /var/lock/mylock
$cat /var/lock/mylock
$cat /var/lock/mylock
$flock /var/lock/mylock ls
$ls
$cat /var/lock/mylock
$

split – split a file into pieces . split [OPTION]… [INPUT [PREFIX]]

commandline session

$ls
sexample
$cat sexample
a
b
c
d
e
f
g
h
i
j
k
l
$split 3 sexample
split: cannot open ‘3’ for reading: No such file or directory
$split sexample 3
$ls
3aa  sexample
$ls -l
total 8
-rw-r--r-- 1 jeffrin jeffrin 24 Jul 31 21:52 3aa
-rw-r--r-- 1 jeffrin jeffrin 24 Jul 31 21:51 sexample
$cat 3aa
a
b
c
d
e
f
g
h
i
j
k
l
$split -n 5  sexample
$ls -l
total 28
-rw-r--r-- 1 jeffrin jeffrin 24 Jul 31 21:52 3aa
-rw-r--r-- 1 jeffrin jeffrin 24 Jul 31 21:51 sexample
-rw-r--r-- 1 jeffrin jeffrin  4 Jul 31 21:54 xaa
-rw-r--r-- 1 jeffrin jeffrin  4 Jul 31 21:54 xab
-rw-r--r-- 1 jeffrin jeffrin  4 Jul 31 21:54 xac
-rw-r--r-- 1 jeffrin jeffrin  4 Jul 31 21:54 xad
-rw-r--r-- 1 jeffrin jeffrin  8 Jul 31 21:54 xae
$cat xaa
a
b
$cat xae
i
j
k
l
$cat xab
c
d
$cat xac
e
f
$cat xad
g
h
$

inner working

mountpoint – see if a directory is a mountpoint

commandline session

$mountpoint
Usage: mountpoint [-q] [-d] [-x] path
$mountpoint /
/ is a mountpoint
$mountpoint /var
/var is not a mountpoint
$mountpoint /usr
/usr is not a mountpoint
$mountpoint -x /dev/sda1
8:1
$mountpoint -x /dev/sda2
8:2
$mountpoint -x proc
mountpoint: proc: No such file or directory
$mountpoint -x /proc/
mountpoint: /proc/: not a block device
$mountpoint  /proc/
/proc/ is a mountpoint
$mountpoint  tmpfs
mountpoint: tmpfs: No such file or directory
$mountpoint  -x tmpfs
mountpoint: tmpfs: No such file or directory
$mountpoint  /run/shm/
/run/shm/ is a mountpoint
$mountpoint  /run/
/run/ is a mountpoint
$mountpoint  /dev/
/dev/ is a mountpoint
$

inner working

dict is a client for the Dictionary Server Protocol (DICT)

commandline session

$dict jeffrin
No definitions found for "jeffrin"
$dict -S
Strategies available:
 exact      Match headwords exactly
 prefix     Match prefixes
 nprefix    Match prefixes (skip, count)
 substring  Match substring occurring anywhere in a headword
 suffix     Match suffixes
 re         POSIX 1003.2 (modern) regular expressions
 regexp     Old (basic) regular expressions
 soundex    Match using SOUNDEX algorithm
 lev        Match headwords within Levenshtein distance one
 word       Match separate words within headwords
 first      Match the first word within headwords
 last       Match the last word within headwords
$dict -S exact linuc
Strategies available:
 exact      Match headwords exactly
 prefix     Match prefixes
 nprefix    Match prefixes (skip, count)
 substring  Match substring occurring anywhere in a headword
 suffix     Match suffixes
 re         POSIX 1003.2 (modern) regular expressions
 regexp     Old (basic) regular expressions
 soundex    Match using SOUNDEX algorithm
 lev        Match headwords within Levenshtein distance one
 word       Match separate words within headwords
 first      Match the first word within headwords
 last       Match the last word within headwords
5 definitions found

From The Collaborative International Dictionary of English v.0.48 [gcide]:

  Exact Ex*act", v. t. [imp. & p. p. {Exacted}; p. pr. & vb. n.
     {Exacting}.] [From L. exactus, p. p. of exigere; or fr. LL.
     exactare: cf. OF. exacter. See {Exact}, a.]
     To demand or require authoritatively or peremptorily, as a
     right; to enforce the payment of, or a yielding of; to compel
     to yield or to furnish; hence, to wrest, as a fee or reward
     when none is due; -- followed by from or of before the one
     subjected to exaction; as, to exact tribute, fees, obedience,
     etc., from or of some one.
     [1913 Webster]

           He said into them, Exact no more than that which is
           appointed you.                           --Luke. iii.
                                                    13.
     [1913 Webster]

           Years of servise past
           From grateful souls exact reward at last --Dryden.
     [1913 Webster]

           My designs
           Exact me in another place.               --Massinger.
     [1913 Webster]

From The Collaborative International Dictionary of English v.0.48 [gcide]:

  Exact Ex*act", a. [L. exactus precise, accurate, p. p. of
     exigere to drive out, to demand, enforce, finish, determine,
     measure; ex out + agere to drive; cf. F. exact. See {Agent},
     {Act}.]
     1. Precisely agreeing with a standard, a fact, or the truth;
        perfectly conforming; neither exceeding nor falling short
        in any respect; true; correct; precise; as, the clock
        keeps exact time; he paid the exact debt; an exact copy of
        a letter; exact accounts.
        [1913 Webster]

              I took a great pains to make out the exact truth.
                                                    --Jowett
                                                    (Thucyd. )
        [1913 Webster]

     2. Habitually careful to agree with a standard, a rule, or a
        promise; accurate; methodical; punctual; as, a man exact
        in observing an appointment; in my doings I was exact. "I
        see thou art exact of taste." --Milton.
        [1913 Webster]

     3. Precisely or definitely conceived or stated; strict.
        [1913 Webster]

              An exact command,
              Larded with many several sorts of reason. --Shak.
        [1913 Webster]

From The Collaborative International Dictionary of English v.0.48 [gcide]:

  Exact Ex*act", v. i.
     To practice exaction. [R.]
     [1913 Webster]

           The anemy shall not exact upon him.      --Ps. lxxxix.
                                                    22.
     [1913 Webster]

From WordNet (r) 3.0 (2006) [wn]:

  exact
      adj 1: marked by strict and particular and complete accordance
             with fact; "an exact mind"; "an exact copy"; "hit the
             exact center of the target" [ant: {inexact}]
      2: (of ideas, images, representations, expressions)
         characterized by perfect conformity to fact or truth ;
         strictly correct; "a precise image"; "a precise measurement"
         [syn: {accurate}, {exact}, {precise}]
      v 1: claim as due or just; "The bank demanded payment of the
           loan" [syn: {demand}, {exact}]
      2: take as an undesirable consequence of some event or state of
         affairs; "the accident claimed three lives"; "The hard work
         took its toll on her" [syn: {claim}, {take}, {exact}]

From Moby Thesaurus II by Grady Ward, 1.0 [moby-thes]:

  183 Moby Thesaurus words for "exact":
     accurate, appreciative, ask, ask for, assess, attentive, badger,
     be hurting for, be indicated, blackmail, brook no denial,
     burden with, call for, careful, challenge, charge, charge for,
     claim, clamor for, close, compel, conscientious, conscionable,
     constant, consummate, correct, critical, cry for, cry out for,
     delicate, demand, demanding, detailed, dictate, differential,
     direct, discriminate, discriminating, discriminative, distinctive,
     distinguishing, enforce, enjoin, even, exacting, exigent, express,
     exquisite, extort, extract, faithful, fasten upon, fastidious,
     faultless, fine, finical, finicking, finicky, force from,
     freight with, full, fussy, gouge, have occasion for, heedful,
     identical, impose, impose on, impose upon, indent, inerrable,
     inerrant, infallible, inflict on, inflict upon, insist on,
     insist upon, issue an ultimatum, lay, lay on, leave no option,
     levy, levy blackmail, literal, make a demand, make dutiable,
     mathematical, methodical, meticulous, micrometrically precise,
     microscopic, minute, narrow, necessitate, need, nice, oblige,
     order, order up, orderly, painstaking, particular, perfect,
     picayune, pinch, pinpoint, place, place an order, precious,
     precise, precisian, precisianistic, precisionist, precisionistic,
     prerequire, pro rata, proper, prorate, pry loose from, punctilious,
     punctual, puristic, put, put down, put in requisition, put on,
     put upon, refined, religious, religiously exact, rend, rend from,
     require, requisition, right, rigid, rigorous, rip, rip from,
     saddle with, scientific, scientifically exact, screw, scrupulous,
     scrutinizing, selective, selfsame, sensitive, set, severe, shake,
     shake down, snatch from, special, specific, square, squeeze,
     stick for, strict, subject to, subtle, tactful, take doing,
     take no denial, task, tax, tear from, thorough, tithe, true,
     undeviating, unerring, very, want, want doing, warn,
     weight down with, wrench, wrench from, wrest, wring, wring from,
     yoke with


No definitions found for "linuc", perhaps you mean:
gcide:  Linum
wn:  linac  linum  linux
jargon:  linus  linux
foldoc:  linc
hitchcock:  Linus
$dict -r jeffrin
No definitions found for "jeffrin"
$dict -rv jeffrin
Configuration file:
   server localhost
   server dict.org
   server dict0.us.dict.org
   server alt0.dict.org
No definitions found for "jeffrin"
$dict -rv unix
Configuration file:
   server localhost
   server dict.org
   server dict0.us.dict.org
   server alt0.dict.org
3 definitions found

From WordNet (r) 3.0 (2006) [wn]:

  UNIX
      n 1: trademark for a powerful operating system [syn: {UNIX},
           {UNIX system}, {UNIX operating system}]

From The Jargon File (version 4.4.7, 29 Dec 2003) [jargon]:

  Unix
   /yoo'niks/, n.

      [In the authors' words, ?A weak pun on Multics?; very early on it was
      ?UNICS?] (also ?UNIX?) An interactive timesharing system invented in 1969
      by Ken Thompson after Bell Labs left the Multics project, originally so he
      could play games on his scavenged PDP-7. Dennis Ritchie, the inventor of C,
      is considered a co-author of the system. The turning point in Unix's
      history came when it was reimplemented almost entirely in C during
      1972?1974, making it the first source-portable OS. Unix subsequently
      underwent mutations and expansions at the hands of many different people,
      resulting in a uniquely flexible and developer-friendly environment. By
      1991, Unix had become the most widely used multiuser general-purpose
      operating system in the world ? and since 1996 the variant called {Linux}
      has been at the cutting edge of the {open source} movement. Many people
      consider the success of Unix the most important victory yet of hackerdom
      over industry opposition (but see {Unix weenie} and {Unix conspiracy} for
      an opposing point of view). See {Version 7}, {BSD}, {Linux}.

      [richiethom]

      Archetypal hackers ken (left) and dmr (right).

      Some people are confused over whether this word is appropriately ?UNIX? or
      ?Unix?; both forms are common, and used interchangeably. Dennis Ritchie
      says that the ?UNIX? spelling originally happened in CACM's 1974 paper The
      UNIX Time-Sharing System because ?we had a new typesetter and {troff} had
      just been invented and we were intoxicated by being able to produce small
      caps.? Later, dmr tried to get the spelling changed to ?Unix? in a couple
      of Bell Labs papers, on the grounds that the word is not acronymic. He
      failed, and eventually (his words) ?wimped out? on the issue. So, while the
      trademark today is ?UNIX?, both capitalizations are grounded in ancient
      usage; the Jargon File uses ?Unix? in deference to dmr's wishes.


From The Free On-line Dictionary of Computing (26 July 2010) [foldoc]:

  Unix

      /yoo'niks/ (Or "UNIX", in the authors'
     words, "A weak pun on Multics") Plural "Unices".  An
     interactive {time-sharing} {operating system} invented in 1969
     by {Ken Thompson} after {Bell Labs} left the {Multics}
     project, originally so he could play games on his scavenged
     {PDP-7}.  {Dennis Ritchie}, the inventor of {C}, is considered
     a co-author of the system.

     The turning point in Unix's history came when it was
     reimplemented almost entirely in C during 1972 - 1974, making
     it the first {source-portable} OS.  Unix subsequently
     underwent mutations and expansions at the hands of many
     different people, resulting in a uniquely flexible and
     {developer}-friendly environment.

     By 1991, Unix had become the most widely used {multi-user}
     general-purpose operating system in the world.  Many people
     consider this the most important victory yet of hackerdom over
     industry opposition (but see {Unix weenie} and {Unix
     conspiracy} for an opposing point of view).

     Unix is now offered by many manufacturers and is the subject
     of an international standardisation effort [called?].
     Unix-like operating systems include {AIX}, {A/UX}, {BSD},
     {Debian}, {FreeBSD}, {GNU}, {HP-UX}, {Linux}, {NetBSD},
     {NEXTSTEP}, {OpenBSD}, {OPENSTEP}, {OSF}, {POSIX}, {RISCiX},
     {Solaris}, {SunOS}, {System V}, {Ultrix}, {USG Unix}, {Version
     7}, {Xenix}.

     "Unix" or "UNIX"?  Both seem roughly equally popular, perhaps
     with a historical bias toward the latter.  "UNIX" is a
     registered trademark of {The Open Group}, however, since it is
     a name and not an acronym, "Unix" has been adopted in this
     dictionary except where a larger name includes it in upper
     case.  Since the OS is {case-sensitive} and exists in many
     different versions, it is fitting that its name should reflect
     this.

     {The UNIX Reference Desk
     (http://geek-girl.com/unix.html)}.

     {Spanish fire extinguisher

  (ftp://linux.mathematik.tu-darmstadt.de/pub/linux/people/okir/unix_flame.gif)}.

     [{Jargon File}]

     (2001-05-14)

$