Bash Workshop

Notes from my freshman-year talk
Alternatives To Bash Workshop
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Learn Vim11,420
24 days ago11other
Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for 📖
Learn Something Every Day409
2 months ago4CSS
📝 A compilation of everything that I learn; Computer Science, Software Development, Engineering, Math, and Coding in General. Read the rendered results here ->
Nanvix82
3 months ago5gpl-3.0C
Educational Spinoff of Nanvix
Neoss74
4 days ago1September 23, 2021bsd-3-clauseTypeScript
:heavy_check_mark: User-friendly and detailed socket statistics with a Terminal UI.
Mentos64
12 days ago1mitC
An educational 32-bit linux-like Operating System, with public bachelor- and master-level course slides.
Multicast Client Server Example53
a month agogpl-2.0C
This is a simple educational example of an IPv4/IPv6 multicast client and server, running under UNIX and Win32.
Seq.asm37
7 years agoAssembly
Minimal implementation of UNIX seq command in x86_64 assembly.
Awesome Programming Books27
2 years ago
List of good programming books for beginners and professionals
Unox Os20
9 months agomitC
Unox is an educational unix-like operating system. #JustForFun
Hardv15
2 months agobsd-3-clauseC
A Powerful Flashcard Program for Unix
Alternatives To Bash Workshop
Select To Compare


Alternative Project Comparisons
Readme

Introduction to Unix Commands

Spartan Hackers

Bash Video

Click the image above to see the screencast!

Windows users should download PuTTY:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Getting Started (5 minutes)

  • Why bash is important to know
  • Understanding the directory structure (tree)

Remember how, on your Desktop, you can manipulate files and folders?

The entire filesystem for your computer is just a MASSIVE tree of folders and folders with files along the way.

Notable Directories

  • Root "/" - The single folder at the core
  • Home "~" - The folder containing everything for your user
  • Working "." - The current folder you're in

...also, I'm gonna refer to folders as directories here on out.

Bits of Bash (20 minutes)

Got that shell open? Time for some basic navigation!

  • ls - list directory contents
  • cd - change working directory
  • touch - change file access and modification times (creates a file)
  • rm - remove directory entries
  • cp - copy files
  • mv - move files
  • clear - clear the terminal screen

Now that you've got those under your belt, we need to talk about command options- or flags. Flags are how we specify additional parameters to our commands similar to passing arguments to a function in programming.

For example: sure, ls lists directory contents but what if I want to see hidden dotfiles? I can include the -a option:

ls -a

Want a "long" listing with lots of additional system information?

ls -l

But how do we familiarize with all of these hidden options? ...I'm glad you asked.

  • man - format and display the on-line manual pages

Time to wing it

Before we move on, you should copy this document onto your desktop:

curl --location goo.gl/NU44jC > ~/Desktop/unix.txt

This will prove a great resource for you to refer back to if you ever get lost or have any nagging questions after the workshop.

I got you. -Steven Kneiser

My Mysterious & Undisputably Dope Project (10 minutes)

Finally! Time to do something both tangible and dope. First thing we're gonna do is remote into a school server:

ssh [email protected]

After entering your password you should be in your user's home directory (represented by the "~"). Next up, we're gonna make a directory for this project called "web" and hop right in there:

mkdir web
cd web

This seems like the PERFECT place to dump my mysterious & undisputably dope file:

curl --location goo.gl/W5GHZd > index.html

Rubs hands together with a devilish grin

Now before I give anything away, I want you to run these two commands:

chmod -R a+rX ~/web
chmod 701 ~/

Congratulations, you've officially setup your very own student homepage! Don't believe me? Visit:

cse.msu.edu/~your_net_id

Q&A & Unix Tips (25 minutes)

Basic Navigation

  • ls & cd
  • touch & rm
  • cp & mv
  • mkdir & rmdir
  • cat & editors (nano, vim, emacs)
  • understanding flags
  • tab-completion & clear
  • finding help (man, apropos, ...then google)

Bash Redirection & Search

  • piping
  • less/more & head & tail
  • grep
  • sort & awk & wc
  • find

Filesystem security

  • reading access rights
  • chmod
  • sudo & su

Running processes (language-specific consoles etc)

  • jobs (listing and suspending)
  • fg & bg
  • ps
  • sending signals

Customizing your environment (dotfiles)

  • environmental variables (echo & printenv)
  • .profile's & rc's (SHELL-DEPENDENT)
  • aliases & functions
  • SSH & simplifying (.ssh/config)
  • package-management

Advanced Miscellaneous

  • keyboard shortcuts (reverse-i search)
  • curly brace completion
  • bash scripting
  • crontab

Further reading

This Repo

Other Unix tutorials

Other shells

More on Unix:

Learning Vim?

Miscellaneous

Popular Unix Projects
Popular Education Projects
Popular Operating Systems Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Html
Shell
Bash
Unix
Education