Create a hard link in UNIX
A hard link is a reference to a file or directory that appears just like a file or directory, not a link. Hard links only work within a file system. In other words, don't use hard links between mounted file systems. A hard link is only a reference to the original file , not a copy of the file . If the original file is deleted, the information will be lost.
To create a hard link of the file /export/home/fred/stuff to /var/tmp/thing, use:
ln /export/home/fred/stuff /var/tmp/thing
The syntax for creating a hard link of a directory is the same. To create a hard link of /var/www/html to /var/www/webroot, use:
ln /var/www/html /var/www/webroot
See also: Create a symbolic link in UNIX
Also see ...
Identify LDAP naming contexts using ldapsearch
H3Using ldapsearch from the command line, it is possible to find all of the naming contexts of the directory server (lowest level distinguished names like o=tech recipes)./H3PThe simplest version of this command (running ldapsearch locally on the LDAP server itself): br / br /div class="c
H3Using ldapsearch from the command line, it is possible to find all of the naming contexts of the directory server (lowest level distinguished names like o=tech recipes)./H3PThe simplest version of this command (running ldapsearch locally on the LDAP server itself): br / br /div class="c
Strip comments from a file
H3This one liner will remove all text after the character in a file/H3Pdiv class="code"cat file with comments sed e 's;.*;;' e '/^&91; &93;*$/d'P/P
H3This one liner will remove all text after the character in a file/H3Pdiv class="code"cat file with comments sed e 's;.*;;' e '/^&91; &93;*$/d'P/P
Convert Macintosh line breaks to Unix line breaks
H3This one liner will convert Macintosh line breaks into Unix line breaks/H3Pdiv class="code"tr '\015' '\012' < macintosh format file > unix friendly fileP/P
H3This one liner will convert Macintosh line breaks into Unix line breaks/H3Pdiv class="code"tr '\015' '\012' < macintosh format file > unix friendly fileP/P
Convert DOS line breaks to Unix line breaks
H3This one liner will convert a file with DOS line breaks to a file with Unix line breaks/H3Pdiv class="code"tr d '\15\32' < dos format file > unix friendly fileP/P
H3This one liner will convert a file with DOS line breaks to a file with Unix line breaks/H3Pdiv class="code"tr d '\15\32' < dos format file > unix friendly fileP/P
Find a file by name in UNIX/Solaris/Linux
H3Using the find command, locate a file by name/H3PTo find a file such as filename.txt anywhere on the system: br / br /div class="code"find / name filename.txt printP br /Recent operating system versions do not require the print option because this is the default. To limit
H3Using the find command, locate a file by name/H3PTo find a file such as filename.txt anywhere on the system: br / br /div class="code"find / name filename.txt printP br /Recent operating system versions do not require the print option because this is the default. To limit
