15 Basic Linux Commands you should know
If you are a technophile and those black screens and hacking scenes in the movie excite you, learning Linux can be an interesting thing for you. Also if you are a beginner in your software development career, you can make yourself qualified and efficient as per today’s tech trends by learning Linux which will help you to cope with all open-source trends and technology.
So, let's start with the very basic commands you need to know in order to operate a Linux system without using the user interface, that you will use periodically.
1. mkdir
To create a directory(folder) in your machine
~$ mkdir new_folder
2. ls
To list down everything from your present working directory
~$ ls
3. cd
To change a directory or move into a different directory. Running this command without an option will take you to the home folder
~$ cd
4. pwd
To check your present working directory
~$ pwd
5. whoami
To get the user name
~$ whoami
6. uname
It tells you which kernel you are using
~$ uname
7. clear
Clears the screen
~$ clear
8. rm
To remove file
~$ rm my_file.txt
9. rm -rf
To remove a directory
~$ rm -rf new_folder
10. touch
To create a file
~$ touch new_file.txt
To create multiple files with dynamic names like File1.txt, File2.txt, ... File10.txt
~$ touch File{1..10}.txt
11. echo
To print an input text
~$ echo "Hello World"
12. cat
To view the content of the file
~$ cat new_file.txt
13. cp
To copy files or directories from the source to the destination. To copy a directory use -r
flag
Below command will copy new_file.txt in one folder back of the present working directory
~$ cp new_file.txt ..
~$ cp -r linux-basics/test ..
14. history
Gives history of all previously executed commands
~$ history
15. man
Provides a user manual of any commands or utilities you can run in the Terminal
~$ man
Conclusion
The above Linux commands will let you perform basic tasks quickly and effectively from the Terminal with more flexibility over your system and the ability to access features that are not always available through a graphical user interface.
Subscribe to my newsletter
Read articles from Sneha Tarnekar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Sneha Tarnekar
Sneha Tarnekar
A Full Stack Developer and Senior Software Engineer skilled in Java, Spring Boot, Angular, Databases, Git, SDLC, and Agile methodology.