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

UNIX, Linux, and Command Line Basics

UNIX, Linux, and Command Line Basics

UNIX, Linux, and Command Line Basics

Henning Schwentner

May 08, 2023
Tweet

More Decks by Henning Schwentner

Other Decks in Programming

Transcript

  1. 26.05.23 //// Seite 10 WPS - Workplace Solutions GmbH WHY

    DO I CARE? § DevOps § Cloud § Docker/Containerization/Virtualization § It’s the 20ies—Even Microsoft <3 Linux § Op: § Servers are typically Linux + Java + (Tomcat) + DB § Start and stop Daemons § Dev: § Tools that help in your developer day
  2. 26.05.23 //// Seite 20 WPS - Workplace Solutions GmbH §

    FHS § Static/ and Shared/Local Files § First Hierarchy § / § /bin, /sbin § /etc § /root, /home § /proc, /dev, /sys?, /mnt § Second Hierarchy § /usr, /var § /usr/bin, /usr/sbin, /usr/X11/bin § /var/tmp § /var/log § Local Hierarchy § /usr/local § Non-packaged tools vs. non-OS tools § Other tools § /opt THE FILESYSTEM TREE
  3. 26.05.23 //// Seite 21 WPS - Workplace Solutions GmbH §

    root § groups § user § Rights: § user § group § world ROLES AND RIGHTS
  4. @hschwentner Shell shell (noun): A piece of software to interact

    with the kernel. Runs typically in a terminal. There are command-line shells and graphical shells.
  5. @hschwentner Important commands • pwd • cd/pushd/popd • ls •

    mkdir/touch • rm • cat/tail/less • man • & bg/fg • . and .. • ls -la
  6. @hschwentner Typical options • - and -- • -v --version

    • -h --help option (noun): An argument that starts with a dash. Several options can be put into one argument.
  7. @hschwentner PIPELINING • Unix commands are generally working on strings

    of characters • STDIN, STDOUT, STDERR • Pipes allow to connect the output of one command to connect to the input of another echo "Hello world" > hallo.txt 2> < echo "Hallo world" | wc
  8. @hschwentner Installers • Debian family • Apt, apt-get, aptitude •

    deb/dpkg • snap • Redhat family • yum • rpm • Zypper • Alpine • apk • OS X • Homebrew, (MacPorts, Fink) • Windows • Cygwin • Chocolatey • Winget
  9. @hschwentner SCRIPTING • Shell scripts • Perl/Python & co. •

    Reg Ex • Scripting in Dockerfiles • Shebang: • #!/bin/sh • #!/usr/bin/env perl
  10. @hschwentner EXERCISE • On Windows 10: install Windows Terminal/Git Bash/Cygwin

    • Create directory learning-unix • Change into that directory • Create a file hello.txt • Change ownership and access of hello.txt • Make it executable
  11. Bibliography Nemeth, Evi, Garth Snyder, Trent R. Hein, Ben Whaley,

    and Dan Mackin. UNIX and Linux System Administrators Handbook. 5th ed. Boston: Addison-Wesley, 2017. Raymond, Eric S. The Art of UNIX Programming. Boston: Addison-Wesley, 2004. Hofer, Stefan and Henning Schwentner. Domain Storytelling: a Collaborative, Visual, and Agile Way to Develop Domain- Driven Software. Boston: Addison-Wesley, 2022.