Linux QuickStart
Linux QuickStart
Linux Introduction
Why Linux?
• OpenSource.
• Community support.
• Heavily customizable.
• Most Servers runs on Linux.
• DevOps most of the tools implements on Linux only.
• Automation
• Secure.
Architecture of Linux
Diffrent Linux distros
➔ Popular Desktop Linux OS
• Ubuntu Linux
• Linux Mint
• Arch Linux
• Fedora
• Debian
• OpenSuse
• Ubuntu Server
• Centos
NOTE: You will also encounter diffrent commands, packages and service names while using
both kinds of distros.
2. Basic Commands
➔ Open Terminal
➔ Create some more directories and list them with “ls” command.
➔ Create some empty files with “touch” command and list them.
➔ Reconfirm your location in your system.
What is a path?
A path is a unique location to a file or a folder in a file system of an OS. A path to a file is a
directory(/). In other words we can say absolute path is a complete path from start of actual
/home/imran/linux-practices/
/var/ftp/pub
/etc/samba.smb.conf
/boot/grub/grub.conf
If you see all these paths started from / directory which is a root directory for
every Linux/Unix machines.
=> Enter.
➔ Read file with cat command.
Types of files in linux.
Symbolic links
Symbolic links are like desktop shortcuts we use in windows.
Create a soft link for /var/log directory in our current working directory.
4. Filter & IO redirection command.
Grep
grep command is used to find texts from any text input.
Passwd file: stores information about all the users in the system
➔ Linux is case sensetive, Root is diffrent that root. Ignoring case in grep with -i option.
Filter Commands
• less: Displays file content page wise or line wise.
Ex: less /etc/passwd
• more
• head
• tail
• cut
• sed
I/O redirection
➔ Search for text “tech” replace it with “tools” and redirect output to a new file.
Find
5. Users & Groups.
USERS
Passwd file
Note: User imran was already a sudo user with full privilege.
➔ Adding user sam in sudoers list.
# wget http://archive.ubuntu.com/ubuntu/pool/universe/t/tree/tree_1.7.0-3_amd64.deb
UBUNTU/DEBIAN
./configure
make
rsync
$ cd # Go to $HOME directory
14. SERVICES
$ sudo service apache2 start # Starts apache2 on ubuntu
18. HARDWARE
$ dmesg => Detected hardware and boot
messages (dmesg many more options)
disk sda
19. STATISTICS
$ top => Display and update the top
cpu processes (30 example options)