Linux Unhatched Cisco Course Review and Notes

Table of Contents

Learning Linux?

Well, Linux Unhatched from CISCO Net Academy is a great place to start.

Depending on your experience, this short course could take you a few days or over a week.

It’s free, well structured, easy to read and interactive. Perfect for learning Linux.

Below are my notes for the course, I skipped 14-14.2 as I’ll be coming back to that section.

*Disclaimer, the course content is owned and shared via CISCO Net Academy.

1. Introduction

Learn Linux: fun, free and everywhere.

Linux: Open source kernel OS and used everywhere on everything

Linux CLI: main user-interactive method.

2. Basic Command Syntax

CLI (Command Line Interface): powers low-power machines, servers or anything.

Command: program executed via CLI

Typing = process run by OS

  • Reads user input (stdin)
  • Manipulates data
  • Produces output (stduout)

Command rules:

  • Names typically describe action.
  • They’re case sensitive.
  • Default behaviour without options/args.

command [options...] [arguments...]

ls lists files in directories.

2.1 Arguments

Arguments specify the command output. ls Documents lists files in Documents directory.

2.2 Options (switches)

Options alter the behaviour of command output. ls -l Documents or ls Documents -l

Multiple options (switches) can be used:

ls -l -r, ls -rl and ls -lr are same.

3. Printing Working Directory

pwd [options] shows current dir

  • Use to be used with printers
  • ~ = /home/user/

4. Changing Directories

Files store data e.g. text, graphics & programs.

  • Directories are files that provide organizational structure.

cd [options] [path]

  • / root dir and path

Filesystem is a map, paths are the directional steps. Two types:

  1. Absoulate: starts from root.
  2. Relative: starts from current dir.

. current dir

.. parent dir

~ home dir

5. Listing Files

ls -l lists files in actual list.

  • File Type
  • Permissions
  • Hard Link Count
  • User Owner
  • Group Owner
  • File Size
  • Timestamp
  • Filename

Sorting switches for ls

-t by timestamp

-s by file size

-r reverse order

6. Administrative Access

su [options] [username] temp act as other user via creating new shell aka change users.

  • By default, su changes to root.
  • Use su -l to proper login as user.

Prompts change depending on user.

sudo [options] command executes commands as other user without creating shell.

  • By default, sudo uses root.

7. Permissions

Determines how users interact with files or dirs. ls -l [filename]

  • File Type
  • Permissions Field
  • Owner
  • Group
  • Other
  • Permission Types: r, w, x.
  • Read:
    • File: see or copy.
    • Dir: non-details shown.
  • Write:
    • File: modified or overwritten
    • Dir: requires execute.
  • Execute:
    • File: run as process.
    • Dir: move dirs

8. Changing File Permissions

  • chmod changes file/dir permissions, only by root or owner. chmod comes from change mode of access.

Two techniques of chmod

  1. Symbolic: good changing one set of permissions at a time.
  2. Octal: good changing all permissions for users, groups, other.

chmod [<SET><ACTION><PERMISSIONS> FILE

  • Set: u, g, o or a
  • Action: +, = or -
  • Permissions: r, w or x

./ indicates commands to run from current dir.

9. Changing File Ownership

Owners of files are the creators of files.

chown changes ownership of files/dirs, requires root priv.

chown [OPTIONS] [OWNER] FILE e.g. chown root hello.sh

10. Viewing Files

cat [OPTIONS] [FILE] concatenate files i.e. good for smaller files.

Pager commands more and less.

head [OPTIONS] [FILE] displays beginning of file, default is 10 lines.

tail [OPTIONS] [FILE] displays end of file, default is 10 lines.

-n switch allows certain number of lines.

11. Copying Files

cp [OPTIONS] SOURCE DESTINATION

Must have x perm to cp file and w x perms on destination dir, both /tmp and ~ will always have this.

11.1 Copying Files

  • dd [OPTIONS] OPERAND copies files/partitions at bit level.

12. Moving Files

mv SOURCE DESTINATION moves files from one to another dir.

mv <file1> <file2> <file3> destination moves multiple files at once.

mv <file1> <newfilename> easily renames file.

w x perms needed on source/dest dirs.

13. Removing Files

rm [OPTIONS] FILE removes files (almost) permanently.

rm -r <dir> removes dirs recurisvley.

w x perms needed to rm files/dirs.

14. Filtering Input

grep [OPTIONS] PATTERN [FILE] filters search input from files.

14.1 Regular Expressions

14.2 Basic Patterns

15. Shutting Down

shutdown [OPTIONS] TIME [MESSAGE] requires date

16. Network Configuration

ifconfig [OPTIONS]

lo loop back 127.0.0.1

ping

17. Viewing Processes

ps [OPTIONS] -e and -f

PID process identifier.

TTY name of terminal.

TIME total time of process.

CMD command started process.

18. Package Management

System to install, update, querie or remove from filesystem.

Debian is the dpkg command but apt-get is front-end program.

  • Update with apt-get update
  • Search with apt-cache search
  • Install: sudo apt-get install [package]
  • Update system: sudo apt-get update && upgrade
  • Remove: apt-get remove [package] and apt-get purge [package]

19. Updating User Passwords

passwd [OPTIONS] [USER] updates user passwords.

  • -S shows status info.

20. Redirection

I/O redirection allows info from CL to be sent to file, device or other commands. Three file descripters:

  1. STDIN: Standard Input, information given to a command.
  2. STDOUT: Standard Out, information displays from output of command.
  3. STDERR: Standard Error, error messages from commands.

[COMMAND] > [FILE] STDOUT redirect

[COMMAND] >> [FILE] append to file.

User must have w perms of files to redirect too.

21. Tex Editor

vi vim or nano


If you have any feedback, please send me a message @mrashleyball.

This is Day 14 of #100DaysOfHacking, subscribe to my newsletter to see the journey!

Happy Hacking.

About The Author
Ashley Ball

Ashley Ball

“Learn, create, share, repeat.” • IT teacher, former web designer, learning #cybersec • Road to #100DaysOfHacking
Share This Article
Share on linkedin
LinkedIn
Share on twitter
Twitter
Share on facebook
Facebook
Share on whatsapp
WhatsApp
Share on email
Email

Monthly Newsletter

Learn about design, web tech and cyber security.

Monthly Newsletter

Learn about design, web tech and cyber security.

This site uses cookies and other tracking technologies to assist with navigation, monitor site usage and web traffic, assist with our promotional and marketing efforts, and customize and improve our services, as set out in our privacy policy