Linux has a basic impact in our life. However, getting started with Linux just make you discomfort for the first time. Because on Linux, you usually should use terminal commands instead of just clicking the launcher icon (as you did on Windows).But don't worry with experience of more than 3 years as a Developer i feel Linux is best as using it.We will give you the mostly used linux commands.
So let's get started with the list of 10 Linux Basic commands -
1. sudo ("superuser do") - Allows you to run other commands with administrative privileges. This is useful when, for example, you need to modify files in a directory that your user wouldn't normally have access to.
$ sudo su
2. ls ("list") - Lists all files and folders in your current working directory. You can also specify paths to other directories if you want to view their contents.
/home$ ls
3. cd ("change directory") - Changes the directory you are currently working in. You can use full paths to folders or simply the name of a folder within the directory you are currently working. Some common uses:
cd / - Takes you to the root directory.
cd .. - Takes you up one directory level.,
cd - - Takes you to the previous directory.
/home $ cd usr
/home/usr $
/home/usr $
4. mkdir ("make directory") - Allows you to create a new directory. You can specify where you want the directory created - if you do not do so, it will be created in your current working directory.
~$ mkdir folderName
5. cp ("copy") - Allows you to copy a file. You should specify both the file you want copied and the location you want it copied to - for example, cp foo /home/john would copy the file "foo" to the directory "/home/john".
$ cp src des
6. mv ("move") - Allows you to move files. You can also rename files by moving them to the directory they are currently in, but under a new name. The usage is the same as cp - mv foo /home/john would move the file "foo" to the directory "/home/john".
$ mv src des
7. rm ("remove") - Removes the specified file.
rmdir ("remove directory") - Removes an empty directory.
rm -r ("remove recursively") - Removes a directory along with its content.
$ rm myfile.txt
8. apt-get - This command differs distro-by-distro. In Debian based Linux distributions, to install, remove and upgrade any package we've Advanced Packaging Tool (APT) package manager. The apt-get command will help you installing the software you need to run in your Linux. It is a powerful command-line tool which can perform installation, upgrade, and even removing your software.
$ sudo apt-get update
In other distributions, such as Fedora, Centos there are different package managers. Fedora used to have yum but now it has dnf.
9. grep -You need to find a file but you don't remember its exact location or the path. grep will help you to solve this problem. You can use the grep command to help finding the file based on given keywords.
$ sudo apt-get update
10. pwd ("print working directory") - Displays the directory you are currently in.
$ pwd
Conclusion
As I mentioned when I started off the article that these 10 basic Linux commands will not make you a Linux geek immediately. It'll help you to start using Linux at this early stage.So it's all for this article. I hope it helped you. Share with us interesting and useful commands in the comment section below and don't forget to share this article with your friends.
Comments
Post a Comment