CT320

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
$ ls ~/bin
checkin		      grade		  lsf	peek	 tools	   wikigrep
checkin-file-checker  grade-busy	  moss	playpen  u	   wikiupdate
checkin_prog	      grade-file-checker  new	ruler	 unold	   wikiwhence
cls		      grades		  note	run	 wikicat
demo-script	      l			  old	runner	 wikidiff
e		      ll		  p	save	 wikiedit
$ 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 Jan 21 01:55 now
$ chmod -w now
$ ls -l now
-r-------- 1 ct320 class 29 Jan 21 01:55 now
$ echo "hi" >now
.script: line 16: 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 Jan 21 01:55:39 MST 2018

Pipes

$ echo "hello" >foo
$ echo "Zeta Eta Theta" >foo
$ date >>foo
$ cat foo
Zeta Eta Theta
Sun Jan 21 01:55:39 MST 2018
$ cat foo | sort
Sun Jan 21 01:55:39 MST 2018
Zeta Eta Theta
$ sort <foo
Sun Jan 21 01:55:39 MST 2018
Zeta Eta Theta
$ sort foo
Sun Jan 21 01:55:39 MST 2018
Zeta Eta Theta

Shell Features

Filter Commands

Resources

Modified: 2017-12-13T11:53

User: Guest

Check: HTML CSS
Edit History Source
Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2015 Colorado State University
CS Building