Day 2 : Basics linux command

Day 2 : Basics linux command

What is linux

Linux is an open-source operating system that was created by Linus Torvalds in 1991. It is a free and powerful alternative to other popular operating systems like Windows and macOS. Linux is highly customizable and allows users to modify and adapt it to their specific needs. It is used in a wide range of applications, from servers to personal computers, and is known for its stability, security, and versatility. Overall, Linux is a robust and flexible operating system that offers users a high degree of control and freedom.

Linux Architecture

The architecture of Linux is based on a monolithic kernel, which means that all operating system services run in kernel space, providing direct access to hardware resources. The kernel is responsible for managing system resources such as memory, CPU, and I/O devices.

The Linux kernel is composed of different subsystems, including process management, memory management, file system, network stack, and device drivers. Each subsystem provides specific functionalities and interacts with other subsystems to provide a complete operating system environment.

In Linux, the shell is a command-line interface that allows users to interact with the operating system by executing commands. The shell is a program that interprets user input, executes commands, and provides output to the user.

Overall, the architecture of Linux is designed to be modular and scalable, allowing users to customize and configure the system to their specific needs while maintaining stability and security.

Linux File system hierarchy

Some basic Linux commands

  1. pwd: Displays the current working directory.

     pwd
    

  2. ls: Lists the contents of a directory.

     ls
    

  3. cd: Changes the current working directory.

     cd <Directories_name>
    

  4. mkdir: Creates a new directory.

     mkdir <Directory_name>
    

  5. rmdir: Deletes an empty directory.

     rmdir <Directory_name>
    

  6. touch: Creates a new empty file or updates the modification time of an existing file.

     touch <file_name>
    

  7. cp: Copies a file or directory.

     cp  Source Destination
     cp  Source Directory
     cp  Source-1 Source-2 Source-3
    

  8. mv: Moves a file or directory.

  9. rm: Removes a file or directory.

     rm <file or diectory name>
    

  10. cat: Displays the contents of a file.

    cat <file_name>
    

    To write something inside a file we use vim command

  11. grep: Searches for a pattern in a file.

    grep pattern [files]
    

  12. ps: Displays information about running processes.

  13. kill: Sends a signal to a process to terminate it.

  14. sudo: Runs a command with superuser privileges.

  15. man: Displays the manual page for a command.

What is the Linux command to

  1. Check your present working directory.

    pwd stands for Print Working Directory.

     pwd
    

  2. List all the files or directories including hidden files.

     ls -a
    

  3. Create a nested directory A/B/C/D/E

     mkdir -p A/B/C/D/E
    

    Thank you for reading

    Let's Connect on LinkedIn.