Linux Terminal Commands List with Example
What Is Linux?
Linux is the kernel of an operating system. You have heard of Unix. Well, Linux is a Unix clone.
But it was actually made by Scratch from Linus Torvalds. Linux is free and open source, it means that you can change anything in Linux and you can redistribute it by your name!
There are several Linux distributions, which are usually called "distros".
- Ubuntu Linux
- Red Hat Enterpris
- Linux Mint
- Debian
- Fedora
- Kali Linux
- Arch Linux
The OS that runs in about 80% of the smartphones in the world, Android, also made from the Linux kernel. Most of the viruses in the world run on Windows, but not on Linux!
Linux Terminal Commands List with Examples
1. pwd: When you open the terminal for the first time, you are in your user's home directory. To know which directory you are in, you can use the "pwd" command. It gives us a complete path, which means starting with root. Root is the basis of the Linux file system. This is represented by a forward slash (/). The user directory is usually something like "/ home / username".
2. ls: Use the "ls" command to know which files are in the directory. You can see all the hidden files using the command "ls -a".
3. cd : Use the "cd" command to go to the directory. For example, if you are in the home folder, and you want to go to the Downloads folder, you can type "cd download".
4. mkdir: When you need to create a folder or directory, use the mkdir command. For example, if you want to create a directory named "DIY", you can type "mkdir DIY". Remember, as mentioned earlier, if you want to create a directory called "DIY Hacking", you can type "mkdir DIY \ Hacking".
5. rmdir : Use rmdir to remove the directory. But rmdir can only be used to remove blank directories. To delete a directory with files, use rm.
6. rm: Use rm commands to delete files and directories. Use "rm -r" to remove only the directory. It only removes both folders and files while using rm commands.
7. touch: Touch commands are used to create files. This can be anything in an empty zip file from an empty txt file. For example, "touch new.txt".
8. man & --help: To learn more about the command and how to use it, use the man command. It shows the manual page of the command. For example, "man cd" shows the manual page of the cd command. Typing in command names and logic helps to show which method of command can be used
9. cp: Use the cp command to copy files through the command line. There are two arguments: The first file to copy is the location of the file, the second place is to copy.
10. mv: Use the mv command to transfer files through the command line. We can also use the mv command to rename the file. For example, if we want to change the "text" file to "new", then we can use "mv text new". Like the cp command, it takes two arguments.
11. locate: The locate command is used to find the file in the Linux system, just like the search command in Windows. This command is useful when you do not know where the file is saved or the actual name of the file. With the command -i logic helps to ignore the case (it does not matter if it is uppercase or lowercase). Therefore, if you want a file that contains the word "hello", it lists all the files in your Linux system that contains the word "hello" when you type "locate -i hello".
12. echo: The "Echo" command helps us move some data, usually texting to the file. For example, if you want to create a new text file or add an already created text file, then you only need to type "echo my name alok >> new.txt". You do not need to separate the spaces using the backward slash, because when we need to write it, we put two triangular brackets
13. cat: Use the cat command to display the contents of the file. Usually programs are used to easily see cat file.txt.
14. sudo: The widely used command in the Linux command line, Sudo stands for "Super User Do". Therefore, if you want to make an order with administrative or root privileges, you can use the sudo command. For example, if you want to edit a file such as alsa-base.conf, which requires 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 your user password. To do this, you can also use the "su" command, but before that you have to set the root password. For this, you can use the "sudo passwd" command. Then type the new root password.
15. df: Use the df command to see the available disk space in each partition in your system. You can just type df in the command line and you can see each mounted partition and their use / available space% and KB. If you want to show it in megabytes, you can use the "df -m" command.
16. du: Use DU to know the disk usage of the file in your system. If you want to know the disk usage for a particular folder or file in Linux, you can type the command df and the name of the folder or file. For example, if you want to know the disk space used by the document folder in Linux, you can use the "du" command
17. tar: Use tar to work with the tarball (or compressed files in the tarball collection) in the Linux command line. It has a long list of uses. It can be used to compress and uncompression of various types of tar archives such as .tar, .tar.gz, .tar.bz2, etc. It works on the basis of given logic. For example, to create a .tar archive, "tar-cvf", -xvf" to ignore a tar archive, to list contents of TVF archives, etc.
18. zip, unzip: Use zip to compress files in a zip archive and unzip to extract files from a zip archive.
19. uname: Use uname to show your information about the Linux distro is running. Using the command "uname -a" prints This print the kernel release date, version, processor type, etc.
25. sudo reboot,sudo halt: You can power off or reboot the computer by using the command sudo halt and sudo reboot.
See: How to Google?
See: How to Become a Computer Expert?
Tags: linux terminal commands,linux basic commands,linux,linux commands,basic linux commands,linux commands with examples,linux command line,basic commands,linux basics,basic commands of linux,learn linux basic commands,linux tutorial,red hat linux basic commands with example,basic unix commands,linux commands with examples and syntax,unix basic commands,linux terminal,linux terminal commands,command
Tags: linux terminal commands,linux basic commands,linux,linux commands,basic linux commands,linux commands with examples,linux command line,basic commands,linux basics,basic commands of linux,learn linux basic commands,linux tutorial,red hat linux basic commands with example,basic unix commands,linux commands with examples and syntax,unix basic commands,linux terminal,linux terminal commands,command
No comments:
Post a Comment