DEV Community

Brian Gachuiga
Brian Gachuiga

Posted on

Introduction to Linux Basics.

  1. Introduction
    Linux is an open-source operating system that is widely used in software development, servers, and cybersecurity. Unlike Windows, Linux relies heavily on a command-line interface (CLI), which allows users to interact with the system using text commands. Learning Linux basics is important because it helps users understand how systems work behind the scenes and improves efficiency when working on technical tasks.

  2. The Command Line Interface and the Shell
    The command line interface (CLI) is a text-based environment where users type commands to perform operations such as navigating files, creating directories, and managing the system.
    The shell is the program that interprets the commands entered by the user. The most common shell in Linux is Bash. When a command is entered, the shell processes it and communicates with the operating system to execute it.

  3. Navigating the Linux File System
    Linux uses a hierarchical file system that starts from the root directory (/). Important commands include:

  4. pwd: shows the current directory

  5. ls: lists files and folders

  6. cd: changes directories
    Example:
    cd Documents
    cd ..

  7. File and Directory Management
    Creating files and folders:

  8. mkdir foldername

  9. touch filename
    Deleting:

  10. rm filename

  11. rmdir foldername
    Copying and moving:

  12. cp file1 file2

  13. mv file1 file2

  14. Working with Files
    Viewing files:

  15. cat filename

  16. less filename
    Editing files:- nano filename
    Writing to files:

  17. echo "Hello" > file.txt

  18. echo "World" >> file.txt

  19. Searching for Files and Content

  20. find . -name "filename"

  21. grep "text" filename
    These commands help locate files and search within them.

  22. File Permissions
    Linux controls access through permissions:

  23. Read (r)

  24. Write (w)

  25. Execute (x)
    To change permissions:

  26. chmod +x script.sh
    To view permissions:

  27. ls -l

  28. Basics of Networking
    Networking allows computers to communicate.
    Useful commands:

  29. ip a (shows IP address)

  30. ping google.com (tests connectivity)
    Key concepts include IP addresses, routers, and DNS.

  31. Package Management
    Software installation in Ubuntu is done using:
    *sudo apt update
    *sudo apt install package-name
    Example:
    sudo apt install git

Top comments (0)