Basic Linux Seminar: Difference between revisions

From DEV UW-Math Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
==January 16, 2017 from 10am to 12pm, B107 Van Vleck==
==January 16, 2017 from 10am to 12pm, B107 Van Vleck==


# Connecting to a linux machine via ssh.
Connecting to a linux machine via ssh.
* hand out account credentials for non-math attendees
* hand out account credentials for non-math attendees
* explain Linux vs. Unix, open source
* explain Linux vs. Unix, open source
# Using SCP to move items from your machine to the server, using sFTP, Filezilla, SecureFX
Using SCP to move items from your machine to the server, using sFTP, Filezilla, SecureFX
* Terminal on mac, linux
* Terminal on mac, linux
* download and install SSH program (like SecureCRT) for Windows.
* download and install SSH program (like SecureCRT) for Windows.
# pwd
pwd
* landing zone  
* landing zone  
* where am I
* where am I
# Creating directories
cd
# Moving around your home directory; pwd
* changing directories
# Moving items in your home directory (2 methods); relative; absolute
* shortcuts for changing directories
# Listing items in your home directory; Listing with command line options.
** ~, ., ..,
# Removing directories and files (use caution!)
* tab completion
# Permissions; recursive, letter method, number method
Creating/removing directories
# Touch command.
* mkdir
# Man command
* rmdir
# Printing items in your home directory to a printer via command line
Creating files
# using lpq to see items in the print queue
* touch
# using lprm to remove items in the print queue.
* nano nameoffile
# editing a file using nano
* nano is a simple (and one of many) text editor, vi, emacs, joe, etc.
# more about file editors.
Moving/Copying/Deleting files
# make your own script
* mv
# quota command; du -s subdir
* cp
# locate command
* rm
#
Listing contents of your directory
* ls
** does not show hidden files/folders
* use of option flags to see more
* ls -l
* ls -la
** does show hidden files/folders
* ls -last
** shows most recently changed/create at top
Permissions
* ls -l shows you the permissions
* discussion of what those permissions mean.
** letter method
** number method
* chmod changing permissions
Man command
Less command
Grep command
Piping
cron
make your own script
* alias command
* writing an actual file, making it executable, and running it.
** Create a bash script in your /usr/bin folder, it should look something like this
 
#!/bin/bash
Whatever combination of commands you want to run when you type this thing.
Its really that easy.
 
Just name the bash script what you want to type in to the terminal, and make it excecutable: chmod +x filename and you're good to go!
quota command; du -s subdir
locate command

Latest revision as of 16:13, 15 January 2017

January 16, 2017 from 10am to 12pm, B107 Van Vleck

Connecting to a linux machine via ssh.

  • hand out account credentials for non-math attendees
  • explain Linux vs. Unix, open source

Using SCP to move items from your machine to the server, using sFTP, Filezilla, SecureFX

  • Terminal on mac, linux
  • download and install SSH program (like SecureCRT) for Windows.

pwd

  • landing zone
  • where am I

cd

  • changing directories
  • shortcuts for changing directories
    • ~, ., ..,
  • tab completion

Creating/removing directories

  • mkdir
  • rmdir

Creating files

  • touch
  • nano nameoffile
  • nano is a simple (and one of many) text editor, vi, emacs, joe, etc.

Moving/Copying/Deleting files

  • mv
  • cp
  • rm

Listing contents of your directory

  • ls
    • does not show hidden files/folders
  • use of option flags to see more
  • ls -l
  • ls -la
    • does show hidden files/folders
  • ls -last
    • shows most recently changed/create at top

Permissions

  • ls -l shows you the permissions
  • discussion of what those permissions mean.
    • letter method
    • number method
  • chmod changing permissions

Man command Less command Grep command Piping cron make your own script

  • alias command
  • writing an actual file, making it executable, and running it.
    • Create a bash script in your /usr/bin folder, it should look something like this
  1. !/bin/bash

Whatever combination of commands you want to run when you type this thing. Its really that easy.

Just name the bash script what you want to type in to the terminal, and make it excecutable: chmod +x filename and you're good to go! quota command; du -s subdir locate command