Linux Command Line
Linux Command Line
Linux Command Line
Linux Command Line
Ken Weiss
HITS Computational Research Consulting Division
A word from our sponsor…
This class is brought to you courtesy of:
Advanced Research Computing – Technical Services
ARC‐TS
For more information please click on:
http://arc‐ts.umich.edu
William E Shotts, Jr.,
“The Linux Command Line: A
Complete Introduction,”
No Starch Press, January 2012.
Download Creative Commons Licensed version at
http://downloads.sourceforge.net/project/linuxcommand
/TLCL/13.07/TLCL‐13.07.pdf.
cja 2014 4 10/14
The command shell
… do things you can’t do from the conventional point‐
and‐click Graphical User Interface (GUI)
kgw 2015 20
http://www.openbookproject.net/tutorials/getdown/unix/lesson2.html
Linux Filesystem Concepts
A file is accessed using its path name
Absolute path name
/dir1/dir2/…/dirn/filename
/usr/X11R6/bin
Relative path name
current‐working‐directory/filename
bin
Every shell maintains a notion of a current working directory
Initialized at login to your home directory
Changed via cd command
Two special directories
. refers to the current directory
.. refers to the current directory’s parent directory
Many ways to get “home”
~ refers to your home directory
$HOME is a synonym for ~
~username refers to a user’s home directory
cja 2014 21 10/14
Basic commands
Exercise: figure out how to make the date command
display the date in Coordinated Universal Time (UTC)
kgw 2015 31
http://www.csit.parkland.edu/~smauney/csc128/fig_permissions.jpg
File Permissions, examples
Exercise: Archive and compress the files in the training directory to a file
named examples_train.tgz
Exercises:
How many users are currently logged in?
How many unique user IDs are currently logged in?
Simple editor
nano
"What you see is what you get” editor
Simple to learn if you want to get started quickly
No mouse support. Arrow keys for navigation
Supported editors
vi or vim
emacs
Powerful but more complex
If you have time and inclination to become proficient,
spend time here
To transfer files (i.e. foobar.txt) FROM a remote host TO your local host use:
~$ scp [email protected]:foobar.txt /some/local/directory
To copy a directory, repeat as above adding the ‐r flag. (~$ scp ‐r … )
Graphical, drag‐and‐drop scp programs are available for Windows and Mac platforms.
(WinSCP – Windows, Cyberduck – Mac)
Demonstration
I will Copy the file headtail.txt from the training directory to /home/kgweiss
directory using SCP on the remote host flux‐xfer.arc‐ts.umich.edu
cja/kgw 2015 45 1/15
Processes
man ps
ps
ps ax
top
man kill