CT320: Network and System Administration

Fall 2018

Bash Interactive

See this page as a slide show

CT320: Bash Interactive

Interactive Bash use

Linux Commands

Paths

PathExplanation
alphaa file in your current directory
beta/gammaa file in the beta directory, which is in your current directory
/delta/epsilona file in the delta directory, which is inside the root directory.
.the current directory
..the parent directory, one level up
/the root directory
~your home directory (only known to the shell, not in a program)
~zetaUser zeta’s home directory (only known to the shell, not in a program)

Directory Navigation

$ cd ~/tmp
$ pwd
/s/bach/a/class/ct320/tmp
$ ls
home.save  icon.png
$ ls ~/bin
checkin		      demo-script	  imv	old	 runner  vman
checkin-file-checker  domoss		  l	p	 save	 wikicat
checkin_prog	      e			  ll	peek	 scores  wikidiff
chit		      grade		  lsf	playpen  stats	 wikiedit
cls		      grade-busy	  moss	pwget	 tools	 wikigrep
cronedit	      grade-file-checker  new	ruler	 u	 wikiupdate
curve		      grades		  note	run	 unold	 wikiwhence
$ mkdir zulu
$ cd zulu
$ pwd
/s/bach/a/class/ct320/tmp/zulu
$ cd
$ pwd
/s/bach/a/class/ct320
$ rmdir tmp/zulu

File Related

Protection Related

$ date >now
$ ls -l now
-rw------- 1 ct320 class 29 Apr 22 16:11 now
$ chmod -w now
$ ls -l now
-r-------- 1 ct320 class 29 Apr 22 16:11 now
$ echo "hi" >now
.script: line 18: now: Permission denied

Process Related

System Related

Linux Shells

Redirection

$ echo "hello" >foo
$ echo "Zeta Eta Theta" >foo
$ date >>foo
$ cat foo
Zeta Eta Theta
Sun Apr 22 16:11:44 MDT 2018

Pipes

$ echo "hello" >foo
$ echo "Zeta Eta Theta" >foo
$ date >>foo
$ cat foo
Zeta Eta Theta
Sun Apr 22 16:11:45 MDT 2018
$ cat foo | sort
Sun Apr 22 16:11:45 MDT 2018
Zeta Eta Theta
$ sort <foo
Sun Apr 22 16:11:45 MDT 2018
Zeta Eta Theta
$ sort foo
Sun Apr 22 16:11:45 MDT 2018
Zeta Eta Theta

Shell Features

Filter Commands

Resources

User: Guest

Check: HTML CSS
Edit History Source

Modified: 2017-12-13T11:53

Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2018 Colorado State University
CS Building