EngineeringSpaceX

Techno and coding blog.

Tuesday 19 December 2017

Basic linux commands for beginners




As a beginner, most of you might find it very discomforting using a Linux Operating System for the first time. This is because in Linux most of the task needs to be performed in its terminal. Even though there are a lot of terminal commands in the Linux system but as a beginner, I have posted few basic but useful commands to get started with this awesome Operating System.


1.sudo

This is SuperUserDo. This is the most used command in the linux environment. Anything that needs admin permission to execute through the terminal, we need to use the sudo command to give the permission.

Example: $ sudo su


2. ls (list)

This command is use when you need to see and the files and folder in a terminal.

Example: /home$ ls ,this will list all the files and folders in the home directory


3. cd (change directory)

This terminal command is used to change the directory. All you have to do is just type the name of the folder you want to go in from your current directory. If you want to go up just do it by giving double dots (..) as the parameter.

Example: let's say you are in the home directory and want to move to the user directory. To do that we have to type the following command
/home$ cd user and it will take you to

/home / user$


4. mkdir (make directory)

This command is used to create a directory(folder). Just type the name of the folder you want to create after mkdir command.

Example: ~$ mkdir FolderName


5. cp (copy and paste)

cp command is also one of the important commands. This helps to copy-paste a file from the terminal. First, you have to type the file name you want to copy and then type the destination where you wanna paste.

Exmaple: ~$ cp FileName Destination

If you are copying a file and you need admin permission to do the task just type the sudo command in front of cp.

Example: ~$ sudo cp FileName Destination


6. rm (remove)

This command is used to remove a file or a directory(folder). With rm command, you can use -f if the file need root permission to be removed. And you can use -r to do recursive removal to remove your folder.

Example: ~$ rm Filename.txt


7. grep

The grep command is just like a search command in the terminal. If you don't remember the location of the file you can you this command to search the file from the terminal.

Example: ~$ cat filename.txt


8. poweroff or shutdown

This command is use to shut down the computer from the terminal.

Example: $ sudo poweroff
                      $ sudo shutdown 

No comments:

Post a Comment