0% found this document useful (0 votes)
33 views

Linux Commands by Javatpont 1

Uploaded by

yaswanth Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
33 views

Linux Commands by Javatpont 1

Uploaded by

yaswanth Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 22
11125122, 1025 AM Linux Commands -javatpaint The following are the top 50 Linux commands: Linux Directory Commands 1. pwd Command ‘The pwd command is used to display the location of the current working directory. Synta pwd Output: 2. mkdir Command ‘The mkdir command is used to create a new directory under any directory. Syntar mkdir Output: 3. rmdir Command ‘The rmdir command is used to delete a directory. Syntax: vame> hitpsihwuujavatpolnt.comiinux-commands#Diectory ser 11125122, 1025 AM Linux Commands -javatpaint Output: 4, Is Command The Is command is used to display alist of content of a directory. Syntax: r exanples oe che coy helto.s orca 5. ed Command ‘The ed command is used to change the current directory. Synta cd Output: hitpsihwuujavatpolnt.comiinux-commands#Diectory 11125122, 1025 AM Linux Commands -javatpaint Linux File commands 6. touch Command ‘The touch command is used to create empty files. We can create multiple empty files by executing it once, Syntax: touch touch Output: Secor eons res eS eacres 7. cat Command The cat command is a multi-purpose utility in the Linux system, It can be used to create a file, display content of the file, copy the content of one file to another file, and more Syntax: cat [OPTION]... [FILE]. To create a file, execute it as follows: cat > 1/ Enter file content Press "CTRL+ D” keys to save the file, To display the content of the fil, hitpsihwuujavatpolnt.comiinux-commands#Diectory ser 11125122, 1025 AM Linux Commands -javatpaint Output: SES aod 8. rm Command The 1m command is used to remove a file. Synta rm Output: ee aeess 9. ep Command ‘The cp command is used to copy a file or directory. Syntax: To copy in the same directory: cp To copy in a different directory: Output: errr ast 5 oe 10. mv Command ‘The my command is used to move a file or a directory form one location to another location. Syntar mv Output: PURE acas 14 eanama Pamnesnd dis used to rename files. tis useful for renaming a lar hitpsihwuujavatpolnt.comiinux-commands#Diectory 11125122, 1025 AM Linux Commands -javatpaint Syntax: rename 's/old-name/new-name/' files For example, to convert all the text files into pdf files, execute the below command: rename 's/\txt$/\ pal “txt Output: $ is oat hello.c coats Linux File Content Commands 12. head Command ‘The head command is used to display the content ofa file. It displays the first 10 lines of a file. Syntax: head Output: tps iwwujavalpolntcomiinuccommands#Directory 6 rer 11125122, 1025 AM Linux Commands -javatpaint 13. tail Command ‘The tail command is similar to the head command, The difference between both commands is that it displays the last ten lines of the file content. It is useful for reading the error message. Syntar tail Output: 14, tac Command The tac command is the reverse of cat command, as its name specified. It displays the file content in reverse order (from the last line). Synta: tac Output: hitpsiwwujavalpalntcomiinuccommandstDirectory ear 11125122, 1025 AM Linux Commands -javatpaint 15, more command The more command is quite similar to the cat command, as it is used to display the file content in the same way that the cat command does, The only difference between both commands is that, in case of larger files, the more command displays screenful output at a time. In more command, the following keys are used to scroll the page: ENTER key: To scroll down page by line. Space bar: To move to the next page b key: To move to the previous page. I key: fo search the string, Synta: more Output: hitpsiwwujavalpolntcomiinuccommands#Directory 10:25 0m Linux Commands -javatpaint 3 gyp.el - font-lock-mode support for gyp Copyright (c) 2012 Google Inc. ALL rights reserved. SC eS gene at Put this sonewhere in your load-path and CED) CD) (eerranaey CeO ea cae Cea aes eR CL (Ce aac ea ee eee em reece aes a To anions) Copco Cuno. Cust ean ee Pes era Cure uc eater) Peete ace Or eee ee coe reemenr mCi tanr arr eee) (string-match "* *L])}1E],)}]* #5" mace ere crenata Nore--(7) 16. less Command The less command is similar to the more command, It also includes some extra features such as ‘adjustment in width and height of the terminal,’ Comparatively, the more command cuts the output in the width of the terminal. Syntax: less Output: Seneca et ceca as Copyright (c) 2612 Google Inc. ALL rights reserved. amet aera nai mea Petirk Gis waco taeaaes PO Teme) *python) CCRC ee ee ees eee Ce Le CSCC Rc Ga S "recent emacsen), not from the older and "python-node.el"})) 2 Cee Urner ee tete re CeCe ec peste Linu Hear Cammands hitpsihwuujavatpolnt.comiinux-commands#Diectory sor 11125122, 1025 AM Linux Commands -javatpaint 17. su Command The su command provides administrative access to another user. In other words, it allows access of the Linux shell to another user. Syntax: su Output: Senet Command The id command is used to display the user ID (UID) and group ID (GID). Pre cow Ce Cer as eat ler OPEC Oat prea 19. useradd Command The useradd command is used to add or remove a user on a Linux server. Syntax: useradd username Output: 1x Pen caer hitpsihwuujavatpolnt.comiinux-commands#Diectory wer 11125122, 1025 AM Linux Commands -javatpaint ‘The passwd command is used to create and change the password for a user. Synta: passwd Output: aneen i cereeesr i) Ges oneen beee ent ic eRCR racers eta 21. groupadd Command The groupadd command is used to create a user group. Synta: groupadd Output: Linux Filter Commands 22. cat Command ‘The cat command is also used as a filter. To filter a file, it is used inside pipes. Syntax: cat | cat or tac | cat or tac | Output: hitpsihwuujavatpolnt.comiinux-commands#Diectory seer 11125122, 1025 AM Linux Commands -javatpaint ‘The cut command is used to select a specific column of a file, The space ("'),a slash (/), a hyphen (-), or anything else, And, the option is used as a delimiter, and it can be a ption is used to specify a column number. Syntar cut -d(delimiter) -(columnNumber) < Output: 24, grep Command ‘The grep is the most powerful and used filter in a Linux system. The ‘grep' stands for “glebal regular expression print. Its useful for searching the content from a file, Generally, itis used with the pipe. Syntax: command | grep Output: eT 25. comm Command The ‘comm’ command is used to compare two files or streams. By default, it displays three columns, first displays non-matching items of the first file, second indicates the non-matching item of the second file, and the third column displays the matching items of both files. Syntar comm Output: hitpsiwwujavalpalntcomiinuccommandstDrectory sar 11125122, 1025 AM Linux Commands -javatpaint nea ers eee Cee 26. sed command The sed command is also known as stream editor. It is used to edit files using a regular expression. It does not permanently edit files; instead, the edited content remains only on display. it does not affect the actual file. Syntax: command | sed 's///' Output: ee s/class/Jtp, ce ae CMET EEC) 27. tee command The tee command is quite similar to the cat command. The only difference between both filters is that it puts standard input on standard output and also write them into a file. Syntax: cat | tee | cat or tac] Output: tps iwwujavalpolntcomiinuccommands#Directory wer 11125122, 1025 AM Linux Commands -javatpaint PSU nC a es reer ee TY fiesta) Hjavatpotatejavatpotnt-Insptron-3542:~$ cat new. txt Fesoec 28. tr Command ‘The tr command is used to translate the file content like from lower case to upper case. Synta command | tr <‘old'> <'new'> Output: rs re eee 29. uniq Command ‘The uniq com land is used to form a sorted list in which every word will occur only once. Syntax: command | uniq Output: Roce eres ees) eT ae fesneee) 30. we Command a ‘The we cammand ic used to count the lines, words, and characters in a file hitpsuiwojavatpoint.cor WiewsecommandekD rectory 1927 11125122, 1025 AM Linux Commands -javatpaint we Output: 31. od Command The od command is used to display the content of a file in different s, such as hexadecimal, octal, and ASCII characters. Syntax: od-b —_// Octal format od -tx1 < Name> //Hexa decimal format od-c — // ASCII character format Output: F 5 ery Prete eo Preece Coc ecretrg Cac CeCe coy E Perr PCeetret oy 32, sort Command The sort command is used to sort files in alphabetical order. Syntax: sort Output: hitpsiwwujavalpolnt.comiinuccommands#Directory 1627 11125122, 1025 AM Linux Commands -javatpant Peters etc ersten eerrr ery ieee) 33. gzip Command The gzip command is used to truncate the file size. It is a compressing tool. It replaces the original file by the compressed file having ‘gz’ extension, Syntax: gzip Output: Ean see rear a Feverratte Feet Cet hour eee a Renter ed faace hello.i Ree came hello. foes er ake eclipse pores foe Petree cr icon rss comers pee eee 34, gunzip Command The gunzip command is used to decompress a file It is a reverse operation of gzip command, Syntax: gunzip Output: Havatpotnt@javatpotnt-Inspiron-3542:~ gunzip Demo.txt Denol.txt Fevers Peete tye Get tr Lee cers eet ce an ences ar roars cers Paeronines rare pt coreg ; ate Leaner xf ra 6 Linux Utility Commands = tpn javatpon contin: ommande#Drectory ter 11125122, 1025 AM Linux Commands -javatpaint The find command is used to find a particular file within a directory. It also supports various options to find a file such as byname, by type, by date, and more The following symbols are used after the find command: (): For current directory name (For root Syntax: find . -name "* pdf" Output: ae a58c5d437b53-1585763620407. pdt jented 36. locate Command The locate command is used to search a file by file name. It is quite similar to find command; the difference is that it isa background process. It searches the file in the database, whereas the find command searches in the file system. Itis faster than the find command. To find the file with the locates command, keep your database updated, Syntax: locate Output: 1x hitpsiiwwujavalpolntcomiinuccommands#Directory seer 11125122, 1025 AM Linux Commands -javatpaint Sean aaa Pera 37. date Command The date command is used to display date, time, time zone, and more, Syntax: date Output: 38. cal Command ‘The cal command is used to display the current month's calendar with the current date highlighted, Synta cal< Output: May 2820 Tu We th 14 39. sleep Command The sleep command is used to hold the terminal by the specified amo 712." seconds. x Synta hitpsihwuuavatpolnt.comiinux-commands#Directory s9e7 11125122, 1025 AM Linux Commands -javatpaint Output: 40. time Command The time command is used to display the time to execute a command a ee ce Crees 41. zcat Command The zeat command is used to display the compressed files Syntax: zat Output: rroness oes oreo cree cca sis : ess cetera 42. df Command ‘The df command is used to display the disk space used in the file system. 1 ' ead hinele awailshle blocks, and the mounted directory. hitpsihwuuavatpolnt.comiinux-commands#Directory 2017 11125122, 1025 AM Linux Commands -javatpaint dt oT a raat Pearce ea ied Preece Cimecere rere rr ee ee ea) re eMC rreee eer rset me wd Perr e ELST coe 7 ELM 4 Brewis Ctr wee) evi Perce SO Ee gue eens E EL /dev/Loop2 Serrery ee eed 384 CeCe Aiea rues (eva z Prat) CEC Wea eee OL] /dev /Loops tre CEC Aerie eee Ce 43, mount Command ‘The mount command is used to connect an external device file system to the system's file system. Syntax: mount -t type Output: RSs oe ee See whe enn aque Che entree ets) proc on /proc type proc (rw,nosutd,nodev,noexec,relatine) Ewes a ce eC meICRr iets eset Ceres ame eT SE SER) toe) Pew Cyne Cr eC cc eC Cen eee) -=088) Fae U tus i eR RUC RL Cae Geer LL Ee) rR aU ese mC Coe or) Cog OW Ey] Saeco ese Seca eMCnCCnC Rt eC WEEE nes eee eC ee) 44, exit Command Linux exit command is used to exit from the current shell, It takes a parameter as a number and exits the shell with a return of status number. Syntax: 2 exit Output: 7 hitpsihwuujavatpolnt.comiinux-commands#Diectory aan 11125122, 1025 AM Linux Commands -javatpaint After pressing the ENTE 45. clear Command Linux elear command is used to clear the terminal screen. Output: ar Pee eerce ac rot After pressing the ENTER key, ill clear the terminal screen, Linux Networking Commands 46. ip Command Linux ip command is an updated version of the ipconfig command. It is used to assign an IP address, initialize an interface, disable an interface. Synta ip a orip addr Output: tps iwwujavalpolntcomiinuccommands#Directory zat 11125122, 1025 AM Linux Commands -javatpaint FE erry Pee aCe nee en ec oe Cte Bea ee ED Poser ey eercrea ores Somer Soest ees) areca: Bee eae a eeeicd Prot ene eer) eerie eet eee Be eres re es eos arem ae a ee eC ene ca ar) facaenear coe eer y eee er eet reac ee eee eeCORC errr ir eCreC Wei aC mL Can ea cs poe eet Poi Teee a Co an ec Pec 47. ssh Command Linux ssh command is used to create a remote connection through the ssh protocol Syntax: ssh user_name@host(IP/Domain_name)

48, mail Command The mail command is used to send emails from the command Ii Syntax: mail -5 "Subject" Output: FES e eee ener rrr er ee err nT cn ey re Paice Sueur 49. ping Command The ping command is used to check the connectivity between two nodes, that is whether the server is connected. It isa short form of "Packet Internet Groper. syntax 6 ping 3 hitpsiwoujavatpoint.cor WinuiccommandekDreclory zat 11125122, 1025 AM Linux Commands -javatpaint Serer ae 89-121) 50(84) cere) com (194.169.80.121): icmp_s CCLRC TCT Mec Cee OE ee tod Ca CCLRC LaLa Me CLC Petz OE SCL GeeCreeC eCO 50. host Command ‘The host command is used to display the IP address for a given domain name and vice versa. It performs the DNS lookups for the DNS Query. Synta host or Output: 2 eer PSS IS [eer eee treec nett © For Videos Join Our Youtube Channel: Join Now Feedback ‘hack to [email protected] hitpsihwuujavatpolnt.comiinux-commands#Diectory pat

You might also like