
Task: What is the Linux command??
The term "Linux command" refers to a command-line instruction or a series of commands used in a Linux operating system. Linux is a Unix-like operating system, and one of its strengths lies in its command-line interface, where users can interact with the system by typing commands.
Linux commands are entered in a terminal or shell, and they perform various tasks such as file manipulation, process management, system configuration, and more. These commands are case-sensitive and often consist of a command name followed by options and arguments.
To view what's written in a file:
cat filenameTo change the access permissions of files:
chmod permissions filenameTo check which commands you have run till now:
historyTo remove a directory/ Folder:
rm -r directorynameTo create a fruits.txt file and to view the content:
touch fruits.txt cat fruits.txtAdd content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava:
echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > devops.txtTo show only the top three fruits from the file:
head -n 3 devops.txtTo show only the bottom three fruits from the file:
tail -n 3 devops.txtTo create another file Colors.txt and to view the content:
touch Colors.txt cat Colors.txtAdd content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey:
echo -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txtTo find the difference between fruits.txt and Colors.txt file:
diff fruits.txt Colors.txt
