Basics of Linux (17 Hours)

Basics of Linux (17 Hours)

Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) Basics of Linux (17 hours) 1.Linux was created in 1991 (The History of Linux began in 1991 with the commencement of a personal project by a Finnish student, Linus Torvalds, to create a new free operating system kernel.) 2.Distributions of Linux (Ubuntu/Debian/CentOS/Fedora/Red Hat/Susi/Google Android is a version of Linux/ DSL(Damn Small Linux)) 3.Linux and Unix are different Oses 4.open source (support licensing / source code)(all open source software are not free, but mostly are) (you are allowed to see the source code)(depending on the license you can modify the code) 5.Shell (GUI(Graphical User Interface)/LUI(Line User Interface)(CLI/Command Line Interface)) (is the screen to interact with the OS) 6.Root user (Root of the operating system is the highest level of the OS)(highest level the users can get into) (Root user is the highest level user, more like Admin user in windows) (home directory is the highest level directory for a particular user) 7.Capitalization is huge thing in Linux: (case sensitive folders and files) (Usernames are case sensitive too) 8.Desktop and Server versions of distributions (mostly the server versions of Linux are CLI based) 9.Linux is used for servers (e.g: Proxy server as squid, Apache Web server etc.) Basics of Linux / Linux Essentials 1 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) ::::GUI and CLI:::: Linux – both CLI and GUI are independent Windows – powershell and GUI Mac – Unix underpinning and still GUI ::Beta vs. Stable:: Beta – Beta is testing, not ready for production. Stable – Stable means it's been tested, and is ready for production. ::::Distributions:::: Debian SUSE Red Hat Cent OS Ubuntu (based on Debian) Raspberry Pi Knoppix ::Desktop Manager:: KDE – SUSE GNOME/Unity – Fedora/Ubuntu Other – Xbuntu/Debian (Any distro can use any desktop manager. These are just default (except unity is Ubuntu's thing, although it is open source) (you can manage the workspace whichever way you like) :::::Linux File System Basics:::::: (forward slash for the root file system) (there are other directories too depending on the distribution) (everything in Linux is a file) (everything is mounted under the /) (under home directory you have all users) (under mnt directory you have all mounted drives) (/etc - has system wide application configuration files) (/home/ali - has user specific application configuration files) (/media - folder for cdroms, etc.) (/lib and /usr/lib - folders for linked library files used by binaries in /bin and /usr/bin) Basics of Linux / Linux Essentials 2 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) (/var/log - folder for log files/for different daemons runnig on the systems) ::Linux Directory Structure:: Basics of Linux / Linux Essentials 3 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) ::::Linux in embedded systems:::: Android phones (Android is a Linux distribution by google) Roku (NowTV box) Kindle Chromebooks Chromecast Mars Rover Factory automation (Vmware ESX is also Linux) Raspberry Pi (model b+) ::OpenSource:: A software whose source code is available for modification by anyone. e.g. Red Hat(paid/source code provided/with support) e.g. CentOS (free/source code/no support) Basics of Linux / Linux Essentials 4 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) ::::Major OpenSource Applications:::: OpenOffice LibreOffice Firefox Thunderbird (email client by firefox) Chromium (opensource of chromeOS) Apache (web server) Samba (Interact with windows file shares) NFS MySQL PostFix apt-get yum Webmin Python Perl SSH Clients Dolphin Browser ::Shell:: The program providing the traditional text interface to the linux system. “command interpreter” -commands, options and arguments -globbing -qouting -variables (and the PATH variable) ::::Installing Linux::::: You can install Ubuntu using a Virtual Box ::Server installation:: 1.server versions are bare-bones (LUI - Line user interface)(CLI) (less attack surface) (runs for years and years without crashing) 2.download Ubuntu (64bit server version) 3.intall->yes->hostname->partition disks(use entire disk)->yes->username->password-> Basics of Linux / Linux Essentials 5 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) 4.DNS/Mail/Print/SAMBA/LAMP(linux apache My php) web server->grub boot loader(for dual boot OSes)-> (no GUI/terminal screen just like DOS prompt)(called bash prompt) (to see the task manager in Linux) fali@ubuntu:~$ top ::Desktop Version:: download the desktop version 32bit version live CD (entire OS is on the CD and you can boot from the CD; and run the OS e.g backtrack for penetration testing) ::Ubuntu Software Centre:: For installing and un-installing software (Categories of tools and programs to install) (Command line programs like apt-get and yum are used to install programs) ::Understanding OpenSource Software and Licensing:: -FSF(Free Software Foundation) -No proprietary -everything free -GPL(General Public License) (everything based on GPL needs to be GPL too) (e.g. Red Hat is GPL so CentOS based on it is also free) -LGPL(Lesser GPL) -FreeBSD -Gnu GPL -OSI(Open Source Initiation) -releasing source code according to their licensing -GPL -LGPL -FreeBSD -BSD -MIT ::Freedom and Business:: -Sell Service and support -Open source option with commercial add-ons (e.g. clearOS, AD connector, smoothwall etc.) -One product open source, other for profit -Hardware vendor might make OS drivers Basics of Linux / Linux Essentials 6 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) ::Terminal Emulator:: CLI for the system ::Console:: Sitting right at the computer :::Basic Linux tasks::: ::clear:: (just to clear the screen) fali@ubuntu:~$clear ::sudo:: root user (just like administrator in windows) you can not login as a root user in ubuntu straight away. sudo (super-user do) (just like run as administrator in windows) ::man Pages:: (manual pages)(just like ? command in MS-DOS) (better to use google instead) fali@ubuntu:~$man ping fali@ubuntu:~$man ls fali@ubuntu:~$man echo fali@ubuntu:~$man man (type the letter 'q' to exit) (searches all man pages for a specific keyword then you can open a specific man page) fali@ubuntu:~$man -k echo ::info:: (more verbose info than man pages) fali@ubuntu:~$info ls fali@ubuntu:~$info ping (documentation for the programs) fali@ubuntu:~$cd /usr/share/doc Basics of Linux / Linux Essentials 7 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) ::tasksel:: (task select) (list of servers to install) fali@ubuntu:~$sudo tasksel password: (e.g. LAMP server) ::apt-get:: (to install individual packages or applications) (installing from repositories) fali@ubuntu:~$sudo apt-get install apache2 (to uninstall the package) fali@ubuntu:~$sudo apt-get remove apache2 (to update the software/checks for the update) fali@ubuntu:~$sudo apt-get upgrade ::Services:: (you have to restart the services sometimes) (usually in windows if a service crashes the whole server crashes, but is not the case with linux) (specific server component e.g. web server stopped) fali@ubuntu:~$sudo /etc/init.d/apache2 start fali@ubuntu:~$sudo /etc/init.d/apache2 stop fali@ubuntu:~$sudo /etc/init.d/apache2 restart ::top:: (similar to task manager in windows) (memory/cpu and processes i.e pid (process id)) fali@ubuntu:~$top k 1578 ('k' is used to kill the process being inside 'top', where 1578 is the pid)(press enter twice then) q (press 'q' to quit or exit) s (press 's' to change the default 3 secs to any number of secs)(how often it refreshes) i (press 'i' to hide all the processes that are idle) (press again for normal view) f (press 'f' to see the fields to display for top command)(to sort by a specific field) Basics of Linux / Linux Essentials 8 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) ::basic navigation:: (to move back to the root directory) fali@ubuntu:~$cd / fali@ubuntu:~$ls (moves to the directory 'etc' under your current directory) fali@ubuntu:~$cd etc fali@ubuntu:/etc~$cd / fali@ubuntu:~$ (/root/folder1/folder2/abc)(case-sensitive)('/' means it will move to root and then sub-directories) (directories below root) fali@ubuntu:~$cd /etc/folder1/abc -absolute path (cd /home/spowers) -relative path (cd spowers) -”.” and “..” -~ (.. means directory above) (. means current directory) (~ current home directory) :::::::::::::::ls:::::::::::::::::::: (to list the files in a directory) fali@ubuntu:~$ls (to see more detailed permissions, name, ownerships and dates for all the files) fali@ubuntu:~$ls -l (shows all files in a block list) fali@ubuntu:~$ls -m (shows files for all the folders under the current directory recursively) fali@ubuntu:~$ls -R (all the files/folders starting with file word) fali@ubuntu:~$ls file* (for recursive detailed and even hidden files) fali@ubuntu:~$ls -Rla Basics of Linux / Linux Essentials 9 Linux basics and Linux Essentials Book (Reference Notes by Farzand Ali) (all the hidden files too) fali@ubuntu:~$ls -a (to hide a file so it doesn't show by ls command) fali@ubuntu:~$mv file1.txt .file1.txt fali@ubuntu:~$ls fali@ubuntu:~$ls -a (seeing the help file for ls) fali@ubuntu:~$ls –-help (seeing the long list of files/folders under a specific path) fali@ubuntu:~$ls -l /home/spowers/documents (to look for specific files under the same directory) fali@ubuntu:~$ls *.txt fali@ubuntu:~$ls file1.* fali@ubuntu:~$ls file?.txt ::search files and directories:: (to search for files and directories) fali@ubuntu:~$sudo find . (find is recursive)( . Means current directory) fali@ubuntu:~$sudo find / fali@ubuntu:~$sudo find . -type f (f means files) (as opposed to 'find .' it only shows the file) fali@ubuntu:~$sudo find . -type d (d means directories) fali@ubuntu:~$sudo find -iname file123 ('-iname' makes it case-insensitive) ( to search every file that starts with php) ('*' wildcard means anything) fali@ubuntu:~$sudo find -iname *php.ini* (to search all .conf file extensions) fali@ubuntu:~$sudo find -iname *.conf fali@ubuntu:~$sudo find -iname “file*” fali@ubuntu:~$sudo find .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    38 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us