Linux Command Line Basics
Linux File System Components
• / -Root directory, contains all subdirectories
• /boot -the Linux kernel and boot loader files are kept here.
• /etc -contains the configuration files for the system.
• /etc/passwd -Contains the essential information for each user.
• /etc/fstab – Contains a table of devices that get mounted at boot.
• /etc/hosts -Network host names and IP addresses that are known.
• /etc/init.d -Contains scripts that start various system services at boot.
• /bin -essential programs that the system requires to operate
• /usr/bin -contains applications for the system's users
FS Continued
• /sbin -Contains programs for system administration
• /usr -Supports user applications
• /usr/share/X11 -Support for the linux GUI
• /usr/share/dict -dictionaries for spell checker
• /usr/share/doc -Documentation files
• /usr/share/man -Man pages
• /usr/src- Source code files
FS Continued
• /usr/local -installation of software
• /var -contains files that change while the system is running
• /var/log -log files
• /var/spool -mail messages and print jobs
• /lib - shared libraries (DLLs)
• /home -Users personal directory
• /root -SU home directory
• /tmp - temporary file storage
FS Continued
• /dev - contains files that represent physical devices. In Linux (like
Unix), devices are treated like files. You can read and write devices as
though they were files.
• /proc -Technically does not exist. Contains peep holes into the kernel
• /media, /mnt -list of attached devices
Command Structure
• Terminal commands follow a set structure
• Command –option [option arguments] command arguments
• Ex. Ping –i 4 www.google.com
Directory Traversal and Analysis
• Commands
• pwd(Print Working Directory)
• ls(List Directory contents)
• If used with no arguments, will return contents of working directory
• If used with arguments, will return contents of that directory
• cd(Change Directory)
• Syntax
• Cd <Directory>-to enter directory
• Cd ..-go up a level
• Cd ~-go to home directory
• file(returns what kind of file)
• Syntax
• File<path to file>
• Modifiers
• less(allows for paged viewing)
Exploration
• Using the previously presented commands, explore the virtual
environment
• What interesting files can you find?
• Where are they?
Manual Pages
• Manual Pages
• Displays command information
• Syntax
• Options
• Uses
• Examples
• Known Bugs
Linux Permissions: Chmod
http://www.thegeekstuff.
com/2010/06/chmod-command-examples/
File Permissions Cheat Sheet
Working with files
• Moving, Removing, and Copying Files
• mv [OPTION]...SOURCE DEST
• Example: mv /home/user/desktop/myfile.txt /home/user/desktop/newFile/myFile.txt
• rm [OPTION]... FILE…
• Example: rm /home/user/desktop/myfile.txt
• cp [OPTION]... SOURCE DEST
• Example: cp /home/user/desktop/myfile.txt /home/user/desktop/backup
More Linux Tutorials
http://www.ee.surrey.ac.uk/Teaching/Unix /