50-Basic commands in linux

Basic commands of linux

pwd command:

                         A path of the current working directory (folder) you’re in
syntax:  pwd


cd command :

                            change the current directory
syntax : cd /var/log

grep command:

                             The 'grep' stands for "global regular expression print.
                           find the text in file .
syntax: grep pattern <file>

sudo command:

                         If you just need to run something as a super user
syntax : sudo

passwd command:

                          This command is used to change the user account password.
syntax : passwd <username>

mv command:

                            To move a file you would use the mv command.
syntax : mv first.txt second.txt

cp command:

                            copy the file
syntax : cp first.txt second.txt

rm command:

                       This command is used to remove files in a directory    
syntax : rm file

mkdir command:

                        To make a directory
syntax : mkdir dirname

chmod command:

                        Change mode of file object.
                        File can r-read w-write and x-execute permission.
syntax ;  chown a-w first.txt  

chown command:

                        This command is used to change the ownership of a file/folder
syntax : chown mysql:mysql text.txt

cat command:

                        view contents of file
syntax : cat file.txt

echo command:

                           This command used to display a text or string.
syntax : echo "hello world"

wc command: 

                        The wc command is used to count the lines and words  in a file.
syntax: wc [option] <file name>

man command:

                        This command is used to view the  reference manual pages
syntax : man mkdir

apt -get command:

                        It is used to install , remove, upgrade  software packages
syntax : apt -get update


touch command:

                        The touch command is used to create empty files.
syntax : touch<file name>

head command:

                        It used to display the content of a file.
syntax : head <filename>

tail command:

                        This tail also similar to the head command.
                        And it help to reading error
syntax : tail <filename>

tac command:

                        It displays the file content in reverse order.
syntax : tac <filename>

more command :

                        The more command is displays screenful output at a time.
syntax : more <filename>

less command :

                        The less command similar to the more command.
syntax : less <filename>

id command:

                    It used to display the  user UID and group GID
syntax : id

useradd command:

                     This command is to add user

syntax : useradd <username>


groupadd command:

                     This command is used to create user group.
syntax : groupadd <group name>


cut command :

                       The cut command is used to select a specific column of a file.
syntax : cut [options] <filename>

comm command :

                        The used to compare two file.
syntax : comm <file1><file2>

sed  command :

                        The sed command also known as stream editor.
syntax : echo name | sed 's/name/antrow/'

tee command  :

                        tee command is similar to the cat command.
syntax : cat <filename> | tee <filename> 

tr command :

                       The file content like from lower case to upper case.
syntax : cat <file name> | tr 'abcd' 'ABCD'

uniq command :    

                        The uniq command is used to form a sorted list in which every word will occur only once.
syntax : sort <filename> | uniq


od command :

                     hexadecimal, octal, and ASCII characters.
syntax : od [options] <filename>

sort command :

                       The sort command is used to sort files in alphabetical order.
syntax : sort <filename>

gzip command:

                        It is a compressing tool.
syntax :  gunzip <file><file>      

find command :    

                         To find a particular file within a directory. 

syntax : find. -name "*.pdf"  


locate command :

                               It is faster than the find command. 
                            To search a file by file name.
syntax : locate <file name>

date command :

                            It is used to display date, time,
syntax : date

cal  command :

                 The current month's calendar

syntax : cal


sleep command :

                    It takes time in seconds.
syntax : sleep <time>

time command:

                     Time to execute a command.
syntax : time

zcat command:

                 used to display the compressed files.
syntax : zcat <file name>    

df command :

                The disk space used in the file system.
syntax : df

exit command:

                 It is used to exit.
syntax : exit

clear command :

                    It is used to clear the terminal screen.
syntax : clear


ip command:

               It is  ipconfig command.
syntax : ip a or ip addr

ssh command:

                ssh command is used to create a remote connection.
syntax : ssh user_name@host name(ip/domain_name)</p>

mail command :

                    The mail command is used to send emails 
syntax : mail -s "subject" < address>

ping command :

                     To check the connectivity between two nodes.
syntax : ping <---------->

host command :    

                       Used to display the IP address for a given domain name 
syntax : host <domain> or <ip addr>


wget command :

                            That helps us to download the files from the web.
syntax : wget
 









            


    






                    


    











Comments

Popular posts from this blog

Python if....elif....else statements

What is InnoDB - Why InnoDB use - ACID properties

Object-oriented programming (OOPs)-python