You are on page 1of 12

GNU/Linux An

Introduction

By - Anurag Rathore
Roll - 63032
GNU + Linux = OS
Features of GNU/Linux

Security.
Free of cost.

Hardware Support.

Less Resource Usage.

Open-Source.

Wide Support community.

Freedom to choose

suitable OS.
Light and Fast.
Shell - Interprets user commands and
logically makes arrangements for them.
Basic Linux Commands
$~su - = Login as root.
#~su harry = Login as user harry.
#~pwd = Shows your present directory.
#~cd = Move through your computer. ( #cd /home/harry/Downloads
moves to Downloads directory of user harry.)
#~touch hello = Makes a file named hello.
#~mkdir Project = Makes a directory named Project.
#~rm hello = Removes the file hello.
#~rmdir Project = Removes the directory Project.
#~clear = Clear the screen.
Basic Linux Commands
#~history = Shows the commands used.
#~man rm = Shows the help and switches used.
#~cat /etc/passwd = Shows the contents of a file.
#~history > /etc/hello = Its called redirection it moves contents of history
into hello file present in /etc directory.
#~cat /etc/passwd | grep anurag = | this is called as a pipe and it pipes
the output of first command as input to second.
#~grep root /etc/passwd = grep is used to find a string in a particular file.
#~mv /etc/hello /world = Renames or moves the file .
#~cp /world /root/file1 = copies the file world to new location.
#~ls = shows the contents ( ls /etc shows content of etc directory.)
Basic Linux Commands
#~find / -name passwd = Searches for a file named passwd in your computer.
#~useradd harry = Adds user harry.

#~passwd harry = Sets password for harry.

#~userdel harry = Delets user harry.

#~groupadd classes = Adds a group and later you can add users to the group.

#~usermod -G classes harry = Adds harry to group classes.

#~groupdel classes= Delete Group

#~chmod 664 /etc/passwd = changes permission for owner,group and others.

#~chown harry:harry /etc/hello = makes harry the file owner and assigns group
harry to the file.
Basic Linux Commands
#~tar cf hello.tar aa bb cc = Adds file aa,bb,cc to archive named as hello
#~gzip aa = Compresses aa with gzip type.(Lowest Compression but fastest)
#~bzip2 bb = Compresses bb with bzip2 type.(Medium compression and medium time)
#~xz cc = Compresses cc with xz type. ( Highest compression but slowest)
#~du -h /etc/exports = Shows file size of file.
#~ifconfig = shows ip addresses of all network interfaces.
#~nmcli connection show = Shows all the connections.
#~nmcli connection add con-name demo if-name etho ipv4.menthod manual ipv4.addresses
172.25.28.11/24 autoconnect yes = Adds an ethernet connection with connection name
demo,network interface eth0,the connection doesnt run on dhcp and is static.The ip addr is
172.25.28.16 and subnet is 255.255.255.0 .
#~df = shows free disks
#~free = shows free ram
#~top = shows running processes
#~reboot = restarts the computer.
THE END

You might also like