Changes between Version 9 and Version 10 of cypress/BasicLinuxComands


Ignore:
Timestamp:
08/19/15 06:28:54 (9 years ago)
Author:
cmaggio
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • cypress/BasicLinuxComands

    v9 v10  
    109109}}}
    110110
     111== rmdir ==
     112Removes directories. The '''rmdir''' is a safer approach than using '''rm -r''' as it will only act on empty directories.
     113
     114{{{
     115[tulaneID@cypress1 ~]$ ls NextDirectoryDown/
     116file.txt
     117[tulaneID@cypress1 ~]$ rmdir NextDirectoryDown/
     118rmdir: failed to remove `NextDirectoryDown/': Directory not empty
     119[tulaneID@cypress1 ~]$ rm NextDirectoryDown/file.txt
     120[tulaneID@cypress1 ~]$ rmdir NextDirectoryDown/
     121[tulaneID@cypress1 ~]$ ls
     122[tulaneID@cypress1 ~]$
     123
     124}}}
     125
    111126=== cp ===
    112127Copy file to new location.
    113128
    114 In the example below file1 already exists, and file2 will become the copy.
    115 {{{
    116 [tulaneID@cypress1 ~]$ cp file1 file2
    117 }}}
    118 To copy a directory and all of its contents:
    119 {{{
    120 [tulaneID@cypress1 ~]$ cp -r dir1 dir2
    121 }}}
    122 
     129In the example below sourcefile already exists, and destinationfile may or may not exist and will become a copy of sourcefile.
     130{{{
     131[tulaneID@cypress1 ~]$ cp sourcefile destinationfile
     132}}}
     133To copy a directory and all of its contents we use the recursive flag '''-r''':
     134{{{
     135[tulaneID@cypress1 ~]$ cp -r sourcedir destinationdir
     136}}}
     137
     138Take note of the order here: source first, destination second. This is the standard order across most *nix commands.
    123139=== mv ===
    124140Move a file to a new location.