CT320

CT320: Network and System Administration

Fall 2017

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
backup-2019  final.csv	IQ04.csv      IQ07.csv	IQ11.csv  IQ15.csv   TLD-save
ch	     IQ01.csv	IQ04-old.csv  IQ08.csv	IQ12.csv  Music.ico  vars
enrolled     IQ02.csv	IQ05.csv      IQ09.csv	IQ13.csv  r7	     z
FINAL	     IQ03.csv	IQ06.csv      IQ10.csv	IQ14.csv  st
$ ls ~/bin
checkin		      curve		  imv	p	 scores   wikidiff
checkin-checker       demo-script	  l	peek	 stats	  wikiedit
checkin-file-checker  domoss		  ll	playpen  tools	  wikigrep
checkin_prog	      e			  lsf	pwget	 u	  wikiupdate
chit		      grade		  moss	ruler	 unold	  wikiwhence
cls		      grade-busy	  new	run	 untar
code		      grade-file-checker  note	runner	 vman
cronedit	      grades		  old	save	 wikicat
$ 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 May  3 06:54 now
$ chmod -w now
$ ls -l now
-r-------- 1 ct320 class 29 May  3 06:54 now
$ echo "hi" >now
/tmp/pmwiki-bash-scripthYalm4: 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
Fri May  3 06:54:24 MDT 2024

Pipes

$ echo "hello" >foo
$ echo "Zeta Eta Theta" >foo
$ date >>foo
$ cat foo
Zeta Eta Theta
Fri May  3 06:54:24 MDT 2024
$ cat foo | sort
Fri May  3 06:54:24 MDT 2024
Zeta Eta Theta
$ sort <foo
Fri May  3 06:54:24 MDT 2024
Zeta Eta Theta
$ sort foo
Fri May  3 06:54:24 MDT 2024
Zeta Eta Theta

Shell Features

Filter Commands

Resources

Modified: 2017-08-20T15:30

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