How to Quick-Start with Bash Commands on Ubuntu 16.04

December 8, 2016 | By the+gnu+linux+evangelist | Filed in: Tutorial.

Terminal Commands Quick Start for Ubuntu 16.04

You are Welcome! The Tutorial Shows You Step-by-step How to Getting-Started with the Bash Commands on Ubuntu 16.04 Xenial Xerus GNU/Linux.

First, this is Just a ‘Quick and Dirty’ Introduction to the Command Line Basics by Example on the Console/Terminal Bash Shell emulator.

Most noteworthy: this Tutorial is Step-by-Step and You Can Just Getting-Started Following and Executing each Command without any Harm for Your System :)

Furthermore, take into account how only the ‘Practice Makes the Master‘; so ‘Take it Easy!‘ ;)

Finally, most Commands should Works also on the others Linux Shells like: Bourne, C, TC and Korn.

How to Quick Start with Bash Commands on Ubuntu 16.04 - Featured
  1. Launching Ubuntu Terminal

    Press: Ctrl+Alt+t
    Or: Cmd/Win and Search ‘terminal’
    Press “Enter” to Execute Commands on Console

    How to Quick Start with Bash Commands on Ubuntu 16.04 - open terminal
  2. To List a Directory’s Contents

    (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
  3. To Change Directory

    cd /[path]

    But to Go into the Home Directory simply:

  4. To Make Directories and Files

    To Create a Directory do:

    mkdir /[path]/myDirectory

    For Instance:

    mkdir $HOME/livingroom

    To Create a Blank File do:

    touch /[path]/myFile

    For Instance:

    touch $HOME/livingroom/box

    And how you could already have perceived, in my creative Examples I make use of the following Mnemonic Linking:

    • Directory -> Spatial Entity

    • File -> Thing

    And so in the Previous Command to an “Empty File” corresponds a natively “Empty Thing” like a “box”, or otherwise you may take it as a simple Label/Name ;)

  5. To Copy Directories and Files

    To Copy a Single File:

    cp /[path1]/myFile1 /[path2]/

    Or also Setting a New File’s Name at the same time:

    cp /[path1]/myFile1 /[path2]/myFile2

    And to Copy Multiple Files at once:

    cp /[path]/myFile1 ... /[pathN]/myFileN 

    (After a ‘\’ Backslash the Command is Not Executed but follows in the Next Line)

    For Instance to Copy a Single File:

    cp $HOME/livingroom/box $HOME/bedroom/ 

    Then to Copy a Single Directory with all its Contents:

    cp -r /[path1]/myDir1 /[path2]/

    Or Setting a New Name:

    cp -r /[path1]/myDir1 /[path2]/myDir2

    Again to Copy Multiple Directories:

    cp -r /[path1]/myDir1 ... /[path]/myDirN 

    Now for Instance to Copy a Single Directory do:

    cp -r $HOME/livingroom $HOME/hello
  6. To Move Directories and Files

    Moving a Single File:

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

    To Move Multiple Files:

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

    And the Same Command is Valid Also for Directories!

    Now for Instance to Move a Single File do:

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

    To Delete a File do:

    rm /[path]/myFile

    For Instance:

    rm $HOME/livingroom/test

    And to Remove a Directory do:

    rm -rf /[path]/myDirectory

    So for Example:

    rm -rf $HOME/livingroom

    -rf” is a combination of Flags. “r” for Recursively and “f” for Forced

  8. How to Get the Admin Super-Powers

    To Login as SuperUser:

    sudo su

    If Got “User is Not in Sudoers file” then see: How to Enable sudo

    Then to Logout:


    To Protect Your System from the potential Damage of an Hazardous Crazy Command Execution the Logout should be executed every Time your Setup is Achieved!
    Finally, to Execute a Single Command as SuperUser:

    sudo su -c 'myCommand'


    sudo myCommand

    So for instance to List the Protected root Directory try to run:

    sudo ls /root
  9. How to Set Permissions on Ubuntu File System

    Ubuntu Permissions Quick Start
  10. Here is achieved the ‘Quick&Dirty’ Initiation to the Ubuntu Command Line Sphere :)
    I’ll be Back Very Soon to Show the Basics of the Apt Software Packages and Repository Administration Commands!

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

QuickChic Theme • Powered by WordPress