IT244 - Introduction to Linux / Unix Instructor: Bo Sheng Get Started IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Outline Working with the shell Basic file operations Editing command lines System info/settings Help and documents Everything is case sensitive
Basic File Operations List files ( ls ) ls pwd (print working directory) ls / ls /home (see your username?) ls /home/shengbo/it244
Basic File Operations Change directory ( cd ) cd / ls pwd cd /home/your username/it244
Basic File Operations Read files ( cat ) cat /home/shengbo/it244/welcome cat /var/run/motd.dynamic Some files are not readable (e.g., binary) cat /bin/cat
Basic File Operations Write/create files ( echo ) ls echo “hello world” > hello cat hello echo “I am your name” >> hello cat hello hello
Basic File Operations Execute files /home/shengbo/it244/exetest Abort execution CTRL+C CTRL+Z and kill CTRL+Z jobs kill %1
Editing Command Lines Delete a char Delete a word ( CTRL+W ) “backspace” and “delete” Delete a word ( CTRL+W ) Delete a line ( CTRL+U ) Arrow keys Up / down: browse the command history Left / right: move the cursor
System info/settings Which shell we are using? What OS is running? ps What OS is running? uname Something you can’t do (su/sudo) Try to create a file under /
Practice ls pwd ls / ls /home cd / cd /home/your username/it244
Practice echo “hello world” > hello ls cat hello echo “I am your name” >> hello cat hello hello /home/shengbo/it244/exetest Press ctrl+c CTRL+Z jobs kill %1
Help and Documents --help option System manuals ( man ) man ls man cat man ssh man man
Help and Documents --help option System manuals ( man ) man ls man cat man ssh man man Reading long manuals Press ENTER, SPACE, and Q
Help and Documents GNU info / pinfo (menu display) Search Keyword info ls info cat info info Control+h Search Keyword man –k apropos whatis
Summary File operations System info Help and documents ls, pwd, cd, cat, echo CTRL+C, CTRL+Z, kill, jobs System info ps, uname Help and documents man, info, apropos, whatis
Questions Use man and info to read the manual of ls and find out how to distinguish files from directories. uname can display a lot more system information. Find a way to display the OS “kernel name” and “kernel release”.