LINUX basic commands and other basics from codewithharry 1 hour video

 1 . cd DIR_NAME (Used to enter in the directory or folder).

2 . cd ..(Used to get out of the folder or to move one step back in the directory).

3 . pwd (Print Working Directory command. It displays the path of the directory where we are at present).

4 . mkdir DIR_OR_FOLDER_NAME (Creates a folder or directory).

5 . touch FILE_NAME.FILE_TYPE (Ex. 1.txt , 2.c etc) (Creates a file).

6 . mv FILE_NAME_OR_FULL_PATH_WITH_FILE_NAME_WHERE_IT_IS_PRESENT DIRECTORY_WHERE_IT_IS_TO_BE_MOVED (Moves a file). 

7 . cp FILE_NAME_OR_FULL_PATH_WITH_FILE_NAME_WHERE_IT_IS_PRESENT DIRECTORY_WHERE_IT_IS_TO_BE_COPIED (Copy a file).

8 . ls (list all the files and directory present in the current directory or folder).

9 . ls -R(R stands for recursive) (list all the files and directory present in current directory or folder and also

 within that directories).

10 . touch .DIR_NAME (Creates a hidden file)

11 . ls -a (lists all the files and folders in the directory also with the hidden files).

12 . clear (Clears the terminal).

13 . history (Displays all the commands that we have entered so far).

14 . echo ANYTHING_TO_BE_PRINTED (IT prints what we enter).

15 . printf "ANYTHING_TO_BE_PRINTED" (IT prints what we enter).

  

   (FACT: Linux is case sensitive, two or more files with same name can be made using lower and uppercase)


16 . sudo COMMAND (It is used to give a command as Root user).

17 . sudo su (Command to tell that take me as a root user).

18 . sudo apt.get update (list down all the updates available in PC).

19 . sudo apt.get upgrade (install all the updates available on PC).

20 . sudo apt install APPLICATION_NAME (Install that application).

21 . ls -l (Watch code with harry video on 46:00).

22 . ls -lart

23 . chmod NUMBER (It changes the permissions to read , write and execute).

24 . top (list down the top resource-consuming processes). (PRESS 'ENTER + Q' TO GET OUT).

25 . ps (list down all the ongoing processes).

26 . ps -a (list down the background processes as well).

27 . ps -ef

28 . kill PROCESS_ID(PID) (Kills that process or ends that process).

29 . vim (to open vim editor).

30 . vim FILE_NAME(to open the file in vim editor).


 /**                    VIM EDITOR COMMANDS AND USAGE


1. i (to start writing)

2. ESCAPE_KEY (to exit writing)

3. :q (to come out without saving)

4. :wq (to save and exit)

5. :q! (to exit without making any changes) (also used to exit when no file is opened)


**/


(  Full form of lart(from comments of the video)

l - LONG LIST FORMAT

a - LIST ALL FILES INCLUDING FILES STARTING WITH "."

r - SORT IN REVERSE ORDER

t - SORT ACCORDING TO MODIFICATION TIME

)




Comments