Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 3: Linux Basic Commands

3.1 Why Linux?

Friends, most servers in the cloud run on Linux, and they have no graphical desktop – all the work happens from the terminal. That is why AWS is incomplete without learning Linux.

More than 90% of cloud servers run Linux. It is free, stable, secure and fully controllable from the command line, which makes automation easy. On AWS, Amazon Linux, Ubuntu, RHEL/CentOS, Debian and SUSE are all available. There is usually no graphical desktop on a server — you manage it through a shell (usually bash) over SSH.

Linux file-system hierarchy

/                  root of everything
├── bin, sbin      essential commands (now links to /usr/bin, /usr/sbin)
├── boot           kernel and boot loader
├── dev            device files (/dev/nvme0n1, /dev/xvda)
├── etc            configuration files (nginx, ssh, fstab, passwd)
├── home           users' home folders (/home/ec2-user, /home/ubuntu)
├── root           home of the root user
├── opt            optional / third-party software
├── tmp            temporary files (cleared on reboot)
├── usr            programs, libraries, docs (/usr/share/nginx/html)
├── var            variable data: logs (/var/log), web (/var/www), databases (/var/lib/mysql)
├── proc, sys      virtual files with kernel & hardware info
└── mnt, media     mount points for extra disks

On the Mauli Dairy server these folders will be used like this: the website files in /usr/share/nginx/html or /var/www/html, the Nginx config in /etc/nginx, and the logs in /var/log. Once this map is in your head, you will immediately know where to look for any file.

Everything is a file

In Linux, disks (/dev/nvme1n1), processes (/proc/1234) and even hardware info are represented as files. Paths are case-sensitive: Index.html and index.html are different files.

Ravindra Bagale's Tip

Many students type cd /Home or Index.html and get stuck with "file not found". Paths in Linux are case-sensitive – Index.html and index.html are two different files. Use the Tab key, and the spelling and case will come out right automatically.

Lab

Chala, EC2 var login karun cat /etc/os-release chalva, mag ls / aani ls /etc bagha. Varchya tree madhle pratyek folder samor ek line liha – udaharan mhanje /var/log madhe logs, /etc madhe config files.