Skip to content

manikcloud/DevOps-Tutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Linux Basic Commands

This README file provides a brief introduction to some essential Linux commands for beginners.

Table of Contents

  1. Navigating the File System
  2. File Management
  3. Directory Management
  4. Permissions
  5. Viewing File Contents
  6. System Information

Navigating the File System

  • To print the current working directory:

    pwd
    
  • To change the current working directory:

    cd [directory]
    
  • To list the contents of a directory:

    ls [options] [directory]
    

File Management

  • To create a new file:

    touch [file]
    
  • To copy a file:

    cp [source] [destination]
    
  • To move a file:

    mv [source] [destination]
    
  • To remove a file:

    rm [file]
    

Directory Management

  • To create a new directory:

    mkdir [directory]
    
  • To remove an empty directory:

    rmdir [directory]
    
  • To remove a non-empty directory:

    rm -r [directory]
    

Permissions

  • To change file or directory permissions:

    chmod [permissions] [file or directory]
    
  • To change file or directory ownership:

    chown [owner] [file or directory]
    

Viewing File Contents

  • To display the contents of a file:

    cat [file]
    
  • To display the first few lines of a file:

    head [file]
    
  • To display the last few lines of a file:

    tail [file]
    

System Information

  • To display system information:

    uname -a
    
  • To display disk usage:

    df -h
    
  • To display memory usage:

    free -h