Basics Commands of Linux with examples
A feature of the Linux operating system is the command. By running commands, you can complete all simple and complex activities. The Linux terminal is used to run the commands. Similar to the command prompt in the Windows OS, the terminal is a command-line interface for interacting with the system. Linux commands are case-sensitive.
Compared to other operating systems like Windows and MacOS, Linux has a robust command-line interface. Through its terminal, we can perform both fundamental and sophisticated tasks. We can perform some simple operations like adding, removing, and moving files. Additionally, we are capable of performing complex jobs including networking chores, administrative tasks (such as package installation and user administration), and (ssh connections).
Linux terminal offers a variety of assistance features, making it a user-friendly terminal. Press “CTRL + ALT + T” keys together to open the Linux terminal, and then press the “ENTER” key to run a command.
Linux Commands with Diagrams:
pwd is used to show the location of the current working directory.
mkdir is used to create the new working directory.
rmdir is used to delete the directory.
ls is used to show the list content of the directory.
cd is used to change the working directory.
6. cd ~
cd ~ is used to move to the previous directory.
touch is used to create empty files.
cat command is used to write content in the file and display the content.
cat command is also used to view the content of the file as well as to display the content.
rm command is used to remove the file.
cp command is used to copy a file or directory.
mv is used to move files or directories from one location to another.
head command is used to display the content of the file and the first 10 lines of the content.
tail displays the last ten lines of the content of the file.
tac works in a reverse way and shows the content in reverse order.
comm is used to compare the files.
wc is used to count the words, characters, and lines in the file.
od command is used to display the file content in different formats like octal, decimal, and hexadecimal.
gzip is used for reducing the file zip and compressing it.
gunzip is used to decompress the file.
These all are the necessary Linux commands to operate the Linux and ubuntu.