Day 2 - Basic Linux Commands

Day 2 - Basic Linux Commands

Linux

Linux is a powerful open-source operating system kernel. It was originally developed by Linus Torvalds in 1991.

Linux is known for its stability, security, and flexibility, and it is widely used in servers, embedded systems, and even desktop computers.

It has a large and active community of developers and users who contribute to its ongoing development and improvement.

Architecture Of Linux

kernel: It is like the heart of the Linux operating system (OS), acting as the central connection between the computer's hardware and its running programs.

Shell: It is a text-based interface where users can enter commands, run programs, and control files like handling files, setting permissions, and managing directories.

Utilities: Utilities are software programs or tools on a computer system that maintain its functionality.

Application: A group of functions created to accomplish specific tasks.

Hardware: It includes devices such as processor(CPU), memory(RAM), storage devices(hard disk drive), input/output devices(keyboard, mouse, display), network interfaces, and other peripherals.

Some basic Linux commands

  1. ls -> It shows available files and directory lists in the present working directory.

  2. ls -l -> It is used for knowing the details of files and directories.

  3. ls -a -> It is used for showing the list of all the hidden files.

  4. pwd -> It displays the present working directory.

  5. cd -> It is used for changing the directory.

  6. cd .. -> It is used to move one directory back from the present directory.

  7. cd ../.. -> It is used to move two previous directories from the present directory.

  8. echo -> It is used to display the line of text or strings that are passed as argument.

  9. cp -> It is used to copy files from one directory to another.

  10. mv -> It is used to rename and replace the files.

  11. touch -> It is used to create empty files.

  12. cat -> It is used to display file content on the terminal.

  13. mkdir -> It is used for creating a new directory

  14. tree -> It is used to display the file system's directory structure in a tree-like format.

  15. rm -> It is used to remove the file.

  16. rm -r -> It is used to remove the directory.

  17. whoami -> It is used to display the current username.

  18. man -> It is used for accessing the lab manual of Linux commands

  19. sudo -> It is used to run commands with administrative privileges.

  20. useradd -> It is used for creating a new user account.

  21. passwd -> It is used for creating a password for the user.

  22. vim -> It is used as an editor to create or edit a text file.

  23. head -> It is used for printing the first ten lines(by default) of a text file.

  24. tail -> It is used to display the last ten lines(by default) of a text file.

Q1. Check your present working directory.

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

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

The -p option stands for "parent" and it allows you to create a directory hierarchy (a tree of directories) in one step, without getting an error if the parent directories already exist.