Sunday, 4 February 2018

Basic Linux Commands for Beginners

Basic Linux Commands for Beginners


Note: we have to use commands in lower case on all linux machines.


1. Print Working Directory:- pwd

When i run this command. It tells me which directory i am currently located at.



2. List :- ls (LS)

It gives what ever inside in the current directory.



3.  Change Directory:- cd   ( Command VARIATIONS)

It is use for navigation. let say i want to go to desktop directory.


b) Change Directory:- cd ..

It is another example of cd using dot dot. when you put dot dot after cd. It will take you back to the previous directory.




c)  Change Directory:- cd /

It will take you to the root directory. 



4. Create file:-Touch 

The touch command is the easiest way to create new empty files. I have created devfile by using touch.


5. Copy:- cp 

I have a dev file and i want to copy this dev file using CP command and pasted into the same folder but with a different name.



6. Remove:-rm

It is used to delete a file from the current directory. However it will prompt to remove or not. If we want to remove put Y or for no N



b) Remove Forcefully:- rm -rf

we cannot delete directory or remove by using rm command however we have to use forcefully by adding dash along with rf command -rf beside rm.





7. Create a new Directory:- mkdir  (Make Directory)

Making a new directory in the current location. However we have to give any name to create a directory. If we just put mkdir without giving any name of the directory. it will give your error. we have to use name of the directory along with mkdir command.

I have given two examples here.




Happy learning

Feel free to contact me at simplyappsdba@gmail.com
















No comments:

Post a Comment