Hello, everyone, this is my second blog and also my second DevOps class. From this blog, I want to share my Second-day experience OR some information on Linux with you. #linux #trainwithshubham #shubhamlondhne
INTRODUCTION TO BASIC LINUX.
Lists of contents.
What is Linux?
what is the Architecture of Linux?
Basics Linux command?
Check your present working directory.
List all the files or directories including hidden files.
Create a nested directory A/B/C/D/E
LETS START WITH SOME INTERESTING INFORMATION
What is Linux?
An open-source operating system (OS) built on the Unix platform is called Linux. It was initially created in 1991 by Finnish software engineer Linus Torvalds, who made it available for use, modification, and distribution under the GNU General Public License.
what is the Architecture of Linux?
The Architecture of the line is:
Application
Shell
Kernel
Hardware
Utilities
Basics Linux command?
just a few fundamental Linux commands are provided here to get you started. Numerous additional effective commands and choices to increase your productivity and control over the system will become apparent as you get more comfortable with Linux. Commands that alter or remove files and directories should be used with caution since they can leave a lasting impression on your system. Before running your commands, always make sure they are correct.
ls
: List files and directories in the current directory.cd
: Change directory. Usecd <directory>
to navigate to a specific directory. For example,cd Documents
will move you to the "Documents" directory.pwd
: Print working directory. It shows the path of the current directory.mkdir
: Create a new directory. For example,mkdir NewFolder
will create a new directory named "NewFolder."rmdir
: Remove an empty directory. Usermdir <directory>
to delete an empty directory.rm
: Remove files or directories. Userm <file>
to delete a file. For directories, you can userm -r <directory>
to remove a directory and its contents recursively.cp
: Copy files and directories. Usecp <source> <destination>
to copy a file or directory. For example,cp file.txt /path/to/destination
will copy "file.txt" to the specified destination.mv
: Move or rename files and directories. Usemv <source> <destination>
to move a file or directory to a new location. To rename a file, simply usemv <old_name> <new_name>
.touch
: Create an empty file. For example,touch new_file.txt
will create a new empty file named "new_file.txt."cat
: Concatenate and display file content. Usecat <file>
to display the contents of a file directly in the terminal.head
: Display the beginning lines of a file. Usehead <file>
to see the first few lines of a file.echo
: Print a message or a variable. For example,echo "Hello, World!"
will print "Hello, World!" to the terminal.grep
: Search for a specific pattern in files. Usegrep <pattern> <file>
to search for a pattern in a file.
Check your present working directory.
The pwd command in the Linux terminal can be used to view your current working directory. The complete path of the directory you are currently in will be displayed if you just type pwd and hit Enter. Using this command, you may rapidly determine where you are in the file system.
List all the files or directories including hidden files.
Use the ls command with the -a or --all option to list every file and directory, including hidden files (those whose names begin with a dot). Here is how to go about it: There are hundreds of hidden files and folders across the Linux operating system. Because they always start with a dot (. ), these files are also known as secret files or dotfiles.
In we can also use -a is used to search all hidden files or directory
Create a nested directory A/B/C/D/E
I am unable to directly create directories on your system, but I can show you how to do so using Python code or command-line instructions on a Unix-like system (such as Linux or macOS).
Using the command line to create nested directories (Unix-like systems): To construct the nested directories, open a terminal and enter the following commands: