Welcome - 9/30/17 [] BEGINNING CLI USAGE ALE - Atlanta Linux Enthusiasts - http://ale.org/ - sign up for our email lists - General email list - ale - ALE Study Group list - ale-study - Meetup.com Group https://www.meetup.com/ALE-Atlanta-Linux-Enthusiasts/ (google "ale linux") THANKS FOR COMING OUT! We are volunteers. Just some guys trying to spread Linux knowledge. Hands-On Today GET YOUR LINUX COMPUTERS UP OPEN A TERMINAL Other Places For Info - EdX - free basic Linux training - Linux.com - free basic Linux training - CheatSheets.org - www.bob-carnaghi-online.net/index.html - ACC Linux Classes - probably millions of others ... - Amazon Prime Videos - _Ubuntu Linux: Go from Beginner to Power User_ - _ITPROtv_ is another search term; - manpages - Dead Trees - books - LPI website - Linux Command Line Book Jumping In ... ls OPEN A TERMINAL - ANY TERMINAL ... - ls - list files and directories - ls -F - ls -al - ls -tl - ls -l | sort -h How Much Storage Available? EXAMPLES: $ du /usr $ du -h ~/ $ df -h . $ df $ df -i $ find /misc/Stuff -type f -size +3G \ -exec ls -lh {} \; - _du_ and _df_ and _find_ - _du_ works on files and directories - _df_ works on partitions and logical volumes - inodes run out too - df -i - _find_ can search for specific things, sizes, etc. Main Directories - HOME directory, $HOME, ~/ - all the same thing - root directory, / - top level of all files and directories - root HOME directory - /root - on Linux systems. - /tmp - a temporary directory. Anyone/nobody can write there. Wiped at reboot - /bin, /usr/bin - where more programs are installed - /etc - where most system and package manager settings are stored - /usr/local/ - where non-package managed, but system-wide programs belong Linux File System Hierarchy Overview [] File System Hierarchy pwd EXAMPLES: $ cd /tmp $ pwd - Present Working Directory - where you currently are in the file system. - Many prompts display it. cd relative and absolute paths These are all the same, if you are in your HOME on a normal Linux system. cd ~ cd cd $HOME cd /home/{your-userid} cd ~/ A different example: cd pwd cd /etc cd cd etc cd ../../etc Cmd History EXAMPLES: $ history $ !! $ !-5 $ !543 $ !vi $ man history # to learn more - Up arrow - ctrl-L/R arrow ... - Can edit the command line - move/delete words, etc. $ ^string1^string2^ Quick substitution. Repeat the last command, replacing string1 with string2. Equivalent to "!!:s/string1/string2/" Tab Completion - Type 3 characters at a time+{tab} - Many command options might be provided - Depends on the bash-completion package - To see which commands beginning with _ls_ exist in your PATH, $ ls{tab}{tab} $ rdi{tab}- -{tab}-l{tab}-i{tab}-s{tab} Practice this. Any interesting ls-cmds? Tab Completion Explained Break Time 5 MINUTES Shells - There are different shells - command lines. - sh, bash, ksh, csh, tcsh, zsh, fish ... others. - Don't like the interface on the command line? - You can change it, but probably shouldn't for 1 yr man -k shells or apropos shells cp, mv, mkdir, rmdir, and File Management EXAMPLES: $ cp /tmp/foo* ~/bin/ $ mv /tmp/foo.txt ~/Docu*/ $ mv /tmp/foo.txt ~/*ts/ $ rm ~/bin/foo* $ rm ~/bin/*oo $ mkdir ~/bin $ mkdir -p /tmp/foo/foo/foo $ rmdir /tmp/foo # work? $ rmdir -p /tmp/foo # work? $ rmdir -p /tmp/foo/foo/foo # work?* - Copy - cp {source} {dest} - Move - mv {source} {dest} # files or dirs - Remove - rm {list} - Rename - what command might work for this? - Make directory - mkdir - Remove directory - rmdir - Pattern matching / _globbing_ can be used where it makes sense Recursive Options - Copy - cp -r {source} {dest} - Remove - rm -r {list} - Move doesn't need recursive - just move the directory Calendar September October November Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 1 2 3 4 5 6 7 1 2 3 4 3 4 5 6 7 8 9 8 9 10 11 12 13 -- 5 6 7 8 9 10 -- 10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 -- 17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 -- 24 25 26 27 28 29 30 29 30 31 26 27 28 29 30 Thanks / Feedback - Thanks for coming. - Please let us know how we are doing. - Slides are here: http://lpi.jdpfu.com/2017-Fall/17-09-30-Basic_Cmds.txt - Email - DJPfulio - at - jdpfu.com blog.jdpfu.com