Day -> 2 of #90daysOfDevOps
Linux Basic for DevOps (First part)
What is Linux?
Linux is the best-known and most-used open source operating system. As an operating system, Linux is software that sits underneath all of the other software on a computer, receiving requests from those programs and relaying these requests to the computer’s hardware. This operating system kernel first released on September 17, 1991, by Linus Torvalds
Why Linux?
Linux might be the perfect platform for you. Linux has evolved into one of the most reliable computer ecosystems on the planet. Combine that reliability with zero cost of entry and you have the perfect solution for a desktop platform.
That’s right, zero cost of entry… as in free. You can install Linux on as many computers as you like without paying a cent for software or server licensing.
Open source...
Linux is a free, open source operating system, released under the GNU General Public License. Anyone can run, study, modify, and redistribute the source code, or even sell copies of their modified code, as long as they do so under the same license.
Varieties of Flavor...
Linux comes in different flavors called as distribution. Each distribution has its own unique style and features of uses.
Command Line Interface...
The Linux command line is a text interface to your computer. Often referred to as the shell, terminal, console etc. It can give the appearance of being complex and confusing to use.
Linux v/s Windows:
Linux | Windows |
Open Source | Closed source |
Cost free | Costly |
More Secure | Need Antivirus |
Low Hardware cost | Higher Hardware cost |
Linux Basic Commands...
ls
: Listing directory- Example: ls -l
lists files in a detailed format.
pwd
: Print the working directory- Example: pwd
shows the current directory path.
cd
: Navigate the directory: Example: cd /path/to/directory
navigate to the specified directory.
mkdir
: Make directory: Example: mkdir new_folder
makes a new directory named as “new_folder
.”
mv
: Move or rename files: Example: mv file.txt otherLocation/
moves the file to a different location.
cp
: Copy: Example: cp file.txt newFolder/
create a copy of the file in the “newFolder”.
rm
: Delete or remove files/directory: Example: rm newFile.txt
removes/delete the file.
touch
: Creates a new file: Example: touch newFile.txt
makes an empty file.
clear
: Clears the terminal: Example: clear
.
cat
: Show the file contents: Example: cat newFile.txt
displays what's inside “newFile.txt.”
echo
: Print text inside the quotes: Example: echo "Hi Guys"
prints "Hi Guys".
man
: Read manual for commands: Example: man ls
shows the manual for the ls
command.
uname
: Get name OS info: Example: uname -a
.
whoami
: Prints your username: Example: whoami
tells the current user.
tar
: Compress file: Example: tar -cvf archive.tar files/
creates a tar archive.
grep
: Search text in the files: Example: grep "pattern" file.txt
finds lines with the pattern.
head
: Show the first part of the file: Example: head -n 10 file.txt
.
tail
: Show the bottom lines of the file: Example: tail -n 5 file.txt
.