Linux Commands | Deep explanation
What is a command? (common world)
A signal that actuates a device (such as a control mechanism in a spacecraft or one step in a computer)
What is a Linux Commands ? (Computer World)
Linux is a Unix-Like operating system. All the Linux/Unix commands are run in the terminal provided by the Linux system.
This terminal is just like the command prompt of Windows OS. Linux/Unix commands are case-sensitive. The terminal can be used to accomplish all Administrative tasks.
This includes package installation, file manipulation, and user management. Linux terminal is user-interactive. The terminal outputs the results of commands which are specified by the user itself.
Execution of typed command is done only after you press the Enter key.
Before learning this, you need to know how to handle and open a terminal
-------------->click here for more details<---------------
Here we can see all the commands under one:)
- pwd - When you first open the terminal, you are in the home directory of your user. To know which directory you are in, you can use the “pwd” command. It gives us the absolute path, which means the path that starts from the root. The root is the base of the Linux file system. It is denoted by a forward slash( / ). The user directory is usually something like "/home/username".
- ls - Use the "ls" command to know what files are in the directory you are in. You can see all the hidden files by using the command “ls -a” and You can see all the file with full details "ls -l".
- cd - Use the "cd" command to go to a directory. For example, if you are in the home folder, and you want to go to the downloads folder, then you can type in “cd Downloads”. Remember, this command is case sensitive, and you have to type in the name of the folder exactly as it is. But there is a problem with these commands. Imagine you have a folder named “menan folder”. In this case, when you type in “cd menan folder”, the shell will take the second argument of the command as a different one, so you will get an error saying that the directory does not exist. Here, you can use a backward slash. That is, you can use “cd menan\ folder” in this case ( \ ),If not so you can use "cd 'menan folder' in the case. Spaces are denoted like this: If you just type “cd” and press enter, it takes you to the home directory. To go back from a folder to the folder before that, you can type “cd ..” . The two dots represent back.
- touch -The touch command is used to create a file. It can be anything, from an empty txt file to an empty zip file. For example, “touch new.txt”.
- mkdir & rmdir — Use the mkdir command when you need to create a folder or a directory. For example, if you want to make a directory called “uki”, then you can type “mkdir uki”.Use rmdir to delete a directory. But rmdir can only be used to delete an empty directory.
- rm - Use the rm command to delete files and directories. Use "rm -r" to delete just the directory. It deletes both the folder and the files it contains when using only the rm command.
- uname - Use uname to show the information about the system your Linux distribution is running. Using the command “uname -a” prints most of the information about the system. This prints the kernel release date, version, processor type, etc.
- sudo - A widely used command in the Linux command line, sudo stands for "SuperUser Do". So, if you want any command to be done with administrative or root privileges, you can use the sudo command. For example, if you want to edit a file like viz. alsa-base.conf, which needs root permissions, you can use the command – sudo nano alsa-base.conf. You can enter the root command line using the command “sudo bash”, then type in your user password. You can also use the command “su” to do this, but you need to set a root password before that. For that, you can use the command “sudo passwd”(not misspelled, it is passwd). Then type in the new root password.
mv - Use the mv command to move files through the command line. We can also use the mv command to rename a file. For example, if we want to rename the file “text” to “new”, we can use “mv text new”. It takes the two arguments,
move files and directories with this command.
-Tips and Tricks for Using Linux Command Line-
- You can use the clear command to clear the terminal if it gets filled up with too many commands.
- TAB can be used to fill up in terminal. For example, You just need to type “cd Doc” and then TAB and the terminal fills the rest up and makes it “cd Documents”.
- Ctrl+C can be used to stop any command in terminal safely. If it doesn't stop with that, then Ctrl+Z can be used to force stop it.
- You can exit from the terminal by using the exit command.
- You can power off or reboot the computer by using the command sudo halt and sudo reboot.
Once you've mastered the Linux commands for beginners, you can move onto these Useful Intermediate Linux Commands.
wow, Really deep explanation.
ReplyDeletethankyou mathavy
DeleteWelldone,usufull commands and explanations.
ReplyDeletethankyou
DeleteExcellent,Good Job
ReplyDelete