Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A quick Linux 102 by Brian Byrne

A quick Linux 102 by Brian Byrne

A quick Linux 102 by Brian Byrne

October 2018, Skills Matter, London.

Brian Linuxing

October 23, 2018
Tweet

More Decks by Brian Linuxing

Other Decks in Technology

Transcript

  1. A quick Linux 102 by Brian Byrne October 2018, Skills

    Matter, London. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  2. Brian Byrne is a freelance IT manager, a thinker and

    do-er for hire. He started coding around 1971, over time he has written programs in 14+ languages, although Turbo Pascal remains one of his favourites. Brian organises Linuxing In London, co-organises London JavaScript Community, Covent Garden Pi Jam and a lot more. He likes tea, good manners and speaking poor Spanish. He prefers community management to being a boring IT Manager and is a bit of a know-all! NB: Brian speaks in paragraphs. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  3. Congratulate yourself! You have a working Linux system. Now we

    have to learn how to manage it. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  4. Brief agenda: Post installation, what must be done, what should

    be done and what could be done. How to operate a Linux system, what to do and what to avoid, covering the Linux command-line extensively. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  5. What this class is not: An MSc in computer science.

    The last word on everything about Linux. But, it will provide: A basic Linux 102, a hands-on approach to managing a Linux system and many of the gotchas! It will be the start of your journey to learnt about Linux. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  6. What we will do: Perform post-installation tasks. Optional customisation and

    nice to have Learn about command line software installation. The power of the cli, basic commands, key files, performance tuning, etc Finally, you will be master of your Linux system. NB: These commands should apply on almost any Debian or Ubuntu derived system, AWS, GCP etc but read the manual. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  7. Prerequisites 1. A working Linux system based on Debian/Ubuntu. 2.

    Pen and paper. 3. Concentration. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  8. A word of warning: Linux is not Windows, don’t treat

    it as if it were. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  9. 1. Perform post-installation tasks. Update the software and install more

    applications [NB: all Linux commands should be in lowercase, Linux is case sensitive] See point 3 Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  10. 2. Gotchas, security and what not to do. [NB: all

    Linux commands should be in lowercase, Linux is case sensitive] A word about normal users and root access. Normally users can not, generally, break a Linux system but root (or superuser) can. sudo <command> sudo -i for a longer session but take extra care. Gotchas: Don’t CTRL-C system updates/upgrades etc or you’ll end up with a broken package management system, treat Linux with respect or it will bite you back. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  11. 3. Perform a complete system upgrade (think Play Store or

    App Store) sudo -i apt-get update && apt-get -V dist-upgrade [Watch the output very carefully, Do it at home, can take 20-30+ minutes, by your router.] Take a break, but remember don't interrupt apt-get or it might break your Linux system. A word on dependency management and libraries. Only install packages via the build-in package manager, apt-get, dpkg or synaptic, etc Do it another way and you risk busting your package management system and Linux! Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  12. 3. Change defaults and create your own user account 3.1

    Type, passwd Pick a new password for the default Linux account. 3.2 sudo -i passwd root 3.3 Type, adduser <your new username> Fill in 3.4 adduser <your new username> sudo Verify new user account has access to sudo, by logging out and logging in again, then type sudo -i from your new account. If in doubt check /etc/sudoers Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  13. 4. More basics software installation with apt-get apt-get update –

    are we online? Give me an up to date feel of all of the packages. apt-get –V install <package> Eg. apt-get –y –V glances apt-cache search chess >file more file grep <text> file apt-get is a frontend to dpkg and ALWAYS the best way, but dpkg -l (L) is useful. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  14. 5. The command line and the shell Recall buffer and

    CTRL-R The history command Writing the history buffer to a file history –w whatihavejustdone.txt history –c Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  15. 6. Some basic Linux commands for file management (think MS-DOS)

    ls – list files, eg. ls -alh mkdir – make a directory cd - change to a directory pwd - where am I cd $HOME – take me to the top level directory more – type something to the console mv – really renames files, use with care cp – copy files tail – the bottom of a file, eg. tail 200 nano – a simple editor rm – erases files, be careful, particularly when in root. rmdir – removed an empty directory diff – compare two files, eg. diff –y –w132 <file1> <file2> Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  16. 7. Key files and how not to break Linux Don’t

    touch anything in /etc unless you have to. Don’t delete anything from /usr/bin or /usr/sbin/ If you need to remove a package use apt-get purge <package> ls –rtcl /var/log is handy tail /var/log/syslog [systemd - journalctl] dmesg – watch like a hawk, use -T to make sense of time Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  17. 8. Performance monitoring with top and free Tuning systems is

    very, very involved and a full time job. top – watch Tasks (top eft) and free memory, q quits, h for help free – shows free memory, more readable with free –m df - look at your devices, e.g. df -h When you run out of memory Linux will start killing processes, run only what you need to execute. If in doubt, use glances, it is very good, install via apt-get Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  18. 9. Shutting down, doing it properly sudo shutdown –h 5

    - halts the system sudo shutdown –r 2 - reboots the system sudo shutdown –c - cancel the shutdown Use these instead of the halt and reboot commands. Don’t just unplug the power! Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  19. 10. Clever things with Linux, using the GUI remotely X

    clients and X servers (1984 - MIT, now seen as X11 - version 11) ssh to the server with the -XC options from Linux then invoke synaptic or firefox. Windows systems need to have an X client running (Xming or Cygwin). Macs might need security options fixing, for more modern systems see XQuartz project. The process load is on the Linux system, not your PC/laptop etc Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  20. 11. Lost your Linux system? Do this only on your

    home network, not anywhere else. apt-get update && apt-get –y –V install zenmap nmap –sP <IP range/24) eg. nmap -sP 192.168.1.0/24 or nmap -sn 192.168.1.* Find your own IP address by typing, ifconfig Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  21. Fini For additional material and answers see the FAQs Linux

    102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  22. Frequently asked questions (FAQs): Q: Where are the slides kept?

    A: These are just draft ones, but the final version will always be at GitHub’s speakerdeck as BrianLinuxing. https://speakerdeck.com/brianlinuxing Q: How does TCP/IP work? A: TCP/IP is an immensely complex network protocol, but from our point of view we just need to know if you plug in a device it will request a TCP/IP address. That address is supplied by a DHCP server. In most instances that will be your home or office router. Q: What does DHCP mean? A: Dynamic Host Configuration Protocol Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  23. FAQs continued: Q: Where can I learn more? Google is

    a good starting place, although many of the articles on the web are over elaborate for beginners. Equally, the forums can be useful at times. Q: Isn't Linux too complicated to learn? Learning Linux is no more complicated than becoming familiar with another language or mastering the art of car driving. It takes patience, a degree of persistence but the rewards are immense. Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  24. FAQs continued: Q: What should I do now? Spent time

    reading, tinkering and if you ruin the Linux's file structure then you can always recreate it using the instructions in Linux 101. Q: My commands never work under Linux on the command line. A: Linux is case sensitive, take extra care. Q: What does && and all of those funny Linux symbols do? A: They are called chaining operators, see https://www.tecmint.com/chaining-operators-in-linux-with-practical-examples/ Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]
  25. FAQs continued: Q: I need help, what do I do?

    A: Type, man <linux command> as a starter or typically <linux command> --help Q: You didn’t answer my question. A: Linux is complex operating system and can’t be rushed! Self study is always useful :) Q: I have many, many more questions where should I go? A: Let Google be your friend in this case :) Linux 102 by Brian Byrne. Twitter:@BrianLinuxing Email: [email protected]