Day 3 - Basic Linux CMD's
I am Yashraj Singh Sisodiya, a 3rd Year CSE student at SVVV, born and raised in Shujalpur. Currently residing in Indore, I'm passionate about pursuing a career in DevOps engineering. My tech journey began with an internship at Infobyte, honing my skills as an Android Developer intern. Alongside my academic pursuits, I actively participate in co-curriculars, holding roles as Technical Lead at Abhyudaya and Cloud Lead at GDSC SVVV, while also serving as an MLSA of my college.
I have a keen interest in Cloud Computing, demonstrated through projects such as User management and Backup using shell scripting Linux, Dockerizing applications, CI/CD with Jenkins, and deploying a 3-tier application on AWS. Always eager to learn, I'm committed to expanding my knowledge and skills in the ever-evolving tech landscape.
To view what's written in a file :
The
catcommand, short for "concatenate," is used to display the content of a file on the terminal. In simpler terms, it lets you see what is inside a file without modifying the file itself. When you use thecatcommand followed by the name of a file, it prints the contents of that file to the terminal.
cat fruit

To view file Permissions:
chmodstands for "change mode," and it is a command used in Unix-like operating systems (including Linux) to change the access permissions of files and directories. Thechmodcommand allows you to control who can read, write, or execute a file.
ls -l

To check which commands you have run till now:
The
historycommand in Unix-like operating systems, including Linux, is used to display a list of previously executed commands in the terminal. When you run commands in a terminal session, a history of those commands is typically maintained, allowing you to review and reuse them.historyTo create a fruits.txt file and to view the content.
The
touchcommand is used in Unix-like operating systems (such as Linux) to create an empty file or update the access and modification timestamps of an existing file.touch fruit.txt
To view and edit content:
nanois a text editor for Unix-like operating systems, including Linux. It's designed to be a simple and user-friendly command-line text editor, suitable for users who may not be familiar with more complex text editors like Vinano fruit.txt

to save and exit from the editor mode use
'CTRL+X'then'Y'Enter.
Add content in fruit.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
vimis a highly configurable text editor for Unix-like operating systems, including Linux. It stands for "Vi IMproved" and is an extended and improved version of the originalvitext editor.vimis known for its powerful features, flexibility, and efficiency, making it a popular choice among developers, system administrators, and other users who work extensively with text files.
vim fruit.txt

want to Save or Quit use Esc:wq want to quit Direct with save Esc:q
To Show only top three fruits from the file.
The
tailcommand is used in Unix-like operating systems, including Linux, to display the last few lines of a text file. It is often used to monitor log files or view updates in real-time.tail -n 3 fruit.txt
Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
To create a file named
color.txtwith seven colors in it, you can use a text editor or command-line tools. Here's an example using theechocommand:echo "Red" > color.txt echo "Orange" >> color.txt echo "Yellow" >> color.txt echo "Green" >> color.txt echo "Blue" >> color.txt echo "Indigo" >> color.txt echo "Violet" >> color.txt
To find the difference between fruits.txt and Colors.txt file.
The
diffcommand is used to display the differences between two text files. It highlights the lines that are unique to each file or shows the lines that differ between them. Here's the basic syntax:diff color.txt fruit.txt




