Join the community today
Become a Member

Sysadmin [Howtoforge.com] Linux Commands - Overview and Examples

Discussion in 'System Administration' started by eva2000, Feb 1, 2018.

  1. eva2000

    eva2000 Administrator Staff Member

    33,733
    7,466
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,479
    Local Time:
    6:49 PM
    Nginx 1.13.x
    MariaDB 5.5
    Linux SSH command line overview and examples Linux Commands - Overview and Examples :)

    Even I learnt some new commands i.e. expand and diff3 !

    diff3 compare 3 text files 1.txt, 2.txt, 3.txt contents
    Code (Text):
    cat 1.txt
    1
    2
    3
    

    Code (Text):
    cat 2.txt
    4
    5
    6
    

    Code (Text):
    cat 3.txt
    7
    8
    9
    

    Code (Text):
    diff3 1.txt 2.txt 3.txt
    ====
    1:1,3c
      1
      2
      3
    2:1,3c
      4
      5
      6
    3:1,3c
      7
      8
      9
    

    Code (Text):
    diff3 --help
    Usage: diff3 [OPTION]... MYFILE OLDFILE YOURFILE
    Compare three files line by line.
    
    Mandatory arguments to long options are mandatory for short options too.
      -A, --show-all              output all changes, bracketing conflicts
    
      -e, --ed                    output ed script incorporating changes
                                    from OLDFILE to YOURFILE into MYFILE
      -E, --show-overlap          like -e, but bracket conflicts
      -3, --easy-only             like -e, but incorporate only nonoverlapping changes
      -x, --overlap-only          like -e, but incorporate only overlapping changes
      -X                          like -x, but bracket conflicts
      -i                          append 'w' and 'q' commands to ed scripts
    
      -m, --merge                 output actual merged file, according to
                                    -A if no other options are given
    
      -a, --text                  treat all files as text
          --strip-trailing-cr     strip trailing carriage return on input
      -T, --initial-tab           make tabs line up by prepending a tab
          --diff-program=PROGRAM  use PROGRAM to compare files
      -L, --label=LABEL           use LABEL instead of file name
                                    (can be repeated up to three times)
    
          --help                  display this help and exit
      -v, --version               output version information and exit
    
    The default output format is a somewhat human-readable representation of
    the changes.
    
    The -e, -E, -x, -X (and corresponding long) options cause an ed script
    to be output instead of the default.
    
    Finally, the -m (--merge) option causes diff3 to do the merge internally
    and output the actual merged file.  For unusual input, this is more
    robust than using ed.
    
    If a FILE is '-', read standard input.
    Exit status is 0 if successful, 1 if conflicts, 2 if trouble.
    
    Report bugs to: bug-diffutils@gnu.org
    GNU diffutils home page: <http://www.gnu.org/software/diffutils/>
    General help using GNU software: <http://www.gnu.org/gethelp/>
    
     
    • Informative Informative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    33,733
    7,466
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,479
    Local Time:
    6:49 PM
    Nginx 1.13.x
    MariaDB 5.5
  3. eva2000

    eva2000 Administrator Staff Member

    33,733
    7,466
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,479
    Local Time:
    6:49 PM
    Nginx 1.13.x
    MariaDB 5.5
    Folks should definitely bookmark and read this linked guide if they want to be more familiar with SSH commands :)

    @sepulchre ;)
     
    • Like Like x 1
  4. JJC84

    JJC84 Premium Member Premium Member

    126
    45
    28
    Jan 31, 2018
    Ratings:
    +67
    Local Time:
    3:49 AM
    1.13.9
    10.1
    Thanks. I know there are many commands some common and some obscure that I still haven't mastered. I will bookmark this resource.
     
    • Like Like x 1
..