πDay 3 Task: Basic Linux Commands
Hello there! I'm a passionate Java Full Stack Developer with expertise in React and an insatiable curiosity for DevOps practices. I am constantly expanding my skill set to deliver seamless end-to-end solutions.
My journey began with Java, where I developed a strong foundation in object-oriented programming and back-end development. Over the years, I have worked extensively with Java frameworks like Spring and Hibernate, leveraging their powerful features to build scalable and efficient server-side applications. From designing robust databases to implementing RESTful APIs.
Eager to enhance my skills, I embarked on a journey to learn DevOps.
#Java #FullStack #React #DevOps #Docker #Kubernetes #Jenkins #Git #Spring #Hibernate #JavaScript #Redux #RESTfulAPIs #CleanCode #ContinuousIntegration #Collaboration #ProblemSolving #SoftwareDevelopment

ππ»1. To view what's written in a file.
βπ½ We can use cat CMD to view the content of the File.
CMD -> cat <filename>
πexample:

ππ»2. To change the access permissions of files.
βπ½ We can use chmod the command allows you to modify these permissions using a numeric or symbolic representation.
πCMD -> chmod <permissions> <filename>
Here's a breakdown of the numeric representation:
π0: No permission (---)
π1: Execute permission (--x)
π2: Write permission (-w-)
π3: Write and execute permissions (-wx)
π4: Read permission (r--)
π5: Read and execute permissions (r-x)
π6: Read and write permissions (rw-)
π7: Read, write, and execute permissions (rwx)
π chmod 777 tasks.md
ππ»3. To check which commands you have run till now.
βπ½ The history command is used to show the list of previously used commands.
πexample:

ππ»4. To remove a directory/ folder
βπ½1. The rmdir command is used to remove empty directories. If the directory you want to remove is empty, you can use the following syntax:
πrmdir <directory_name>
π If the directory is not empty, you will receive an error and the directory will not be removed. In that case, you can use the rm command.
βπ½2. The rm command is more versatile and can be used to remove both files and directories, including non-empty directories. However, be cautious when using rm as it permanently deletes the specified files and directories.
πrm -r <directory_name>
ππ»5. To create a fruits.txt and to view the content.
βπ½. The touch command is used to create an empty file.
πtouch <file_name>
πcat <file_name>
Example:

ππ»6. Add content in fruits.txt(One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
βπ½ We can use Vim or any other editor.

ππ»7. To show only top three fruits from the file.
βπ½ The head command is used to display the first few lines of a file on the command line
πhead -n 3 fruits.txt

ππ»8. To show only last three fruits from the file.
βπ½ The tail command is used to display the last few lines of a file on the command line
πtail -n 3 fruits.txt

ππ»9. To create a colors.txt and to view the content.
βπ½1. The touch command is used to create an empty file.
πtouch <file_name>
πcat <file_name>
ππ»10. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
βπ½ We can use Vim or any other editor.

ππ»11. To find the difference between fruits.txt and colors.txt file.
βπ½The diff command compares files line by line and displays the differing content.
πdiff [options] <file1> <file2>

π Conclusion:
Congratulations! π Linux is a powerful, open-source operating system. We hope this blog has given you a Question/Answer π Embrace the Linux power and have fun with your Linux journey! π§πͺ
π Did you find this blog helpful? Let us know in the comments below! π And if you have any questions or need further assistance, we're here to help! π€
Happy Linux-ing! π»β¨