Command Line Mac High-Sierra Getting Started Guide

Getting-Started with Terminal Commands on Mac 10.13

Hi! The Tutorial Shows You in Easy Steps How-to Quick-Start with the Console/Terminal Command-Line/Shell on Mac 10.13 High-Sierra BSD/Unix.

This is Just a ‘Quick and Dirty’ Introduction to the Command Line Basic Instructions on Mac Command Line Console Terminal.

The Tutorial is Step-by-Step and You Can Just Getting-Started Following and Executing each Command without any Harm for Your System 🙂

After all only ‘Practice Makes the Master‘; so Do Not try to Getting-Started too Hard but Just ‘Take it Easy!‘ 😉

The Commands are Intended for Execution on the Bash Shell but Most should Works also for the Bourne, C, TC and Korn Shells…

Mac 10.13 High-Sierra Command Line Console Terminal Quick-Start - Featured
  1. To

    Open a Terminal Shell emulator window
    Launch Finder:

    Getting-Started Command Line Terminal for Mac 10.13 High-Sierra - Launch Finder




    Select Applications:

    Getting-Started Command Line Terminal for Mac 10.13 High-Sierra - Open Applications




    Double-Click on Utilities:

    Getting-Started Command Line Terminal for Mac 10.13 High-Sierra - Open Utilities




    Double-Click over Terminal:

    Getting-Started Command Line Terminal for Mac 10.13 High-Sierra - Launch Terminal
  2. Switch to the Bash Shell
    (Press “Enter” to Execute Commands)

    bash
  3. To List a Directory Content (Directories and Files included)

    ls [/path]

    For Example to List the Content of the Root Directory:

    ls /

    Or to List the Content of the Home Directory:

    ls $HOME
  4. To Change Directory

    cd [/path]

    For Example to Go into the Home Directory:

    cd $HOME
  5. To Create Directories and Files

    To Create a Directory do:

    mkdir [/path]/myDirectory

    For Instance:

    mkdir $HOME/test

    To Create a Blank File do:

    touch [/path]/myFile

    For Instance:

    touch $HOME/test/test
  6. To Copy Directories and Files

    To Copy a Single File:

    cp [/path]/myFile1 [/path]/toTargetDirectory/myEventualNewFileName

    (After a ‘\’ to Press ‘Enter’ the Command is Not Executed but instead only a ‘Carriage Return’ Like in a Typewriter)
    To Copy Multiple Files:

    cp [/path]/myFile1 ... [/path]/myFileN \
    [/path]/toTargetDirectory/

    For Instance to Copy a Single File:

    cp $HOME/test/test $HOME/test/hello 

    To Copy a Single Directory:

    cp -r [/path]/myDirectory1 [/path]/toTargetDirectory/myEventualDirectoryName

    To Copy Multiple Directories:

    cp -r [/path]/myDirectory1 ... [/path]/myDirectoryN \
    [/path]/toTargetDirectory/

    Now for Instance to Copy a Single Directory do:

    cp -r $HOME/test $HOME/hello
  7. To Move Directories and Files

    Moving a Single File:

    mv [/path]/myFile1 [/path]/toTargetDirectory/myEventualNewFileName

    To Move Multiple Files:

    mv [/path]/myFile1 ... [/path]/myFileN \
    [/path]/toTargetDirectory/

    The Same Command is Valid Also for Directories!

    Now for Instance to Move a Single File do:

    mv $HOME/test/test $HOME/hello/hello
  8. To Delete Directories and Files

    To Delete a File do:

    rm [/path]/myFile

    For Instance:

    rm $HOME/test/test

    Removing a Directory do:

    rm -rf [/path]/myDirectory

    For Instance:

    rm -rf $HOME/test
  9. Last How-to Get the Admin Super-Powers

    To Login as SuperUser:

    sudo su

    To Logout from SuperUser:

    exit

    (To Protect Your System from the possible Damages of an Hazardous ‘Crazy’ Command Execution the Logout ‘Should’ be Executed Every Time a Conscious and Meaningful Series of Commands has been Achieved… )
    To Execute a Command as SuperUser:

    sudo myCommand
  10. How-to Set Permissions on Mac File System:

    Mac Permissions Quick-Start
  11. Here is achieved the ‘Quick&Dirty’ Initiation to the Mac Linux Command Line Sphere 🙂
    I’ll be Back Very Soon to Show the Basics of the Apt Software Packages and Repository Administration Commands!