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.
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)
- Names typically describe action.
- They’re case sensitive.
- Default behaviour without options/args.
command [options...] [arguments...]
ls lists files in directories.
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
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:
- Absoulate: starts from root.
- Relative: starts from current dir.
. current dir
.. parent dir
~ home dir
5. Listing Files
ls -l lists files in actual list.
- File Type
- Hard Link Count
- User Owner
- Group Owner
- File Size
Sorting switches for
-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,
suchanges to root.
su -lto proper login as user.
Prompts change depending on user.
sudo [options] command executes commands as other user without creating shell.
- By default,
Determines how users interact with files or dirs.
ls -l [filename]
- File Type
- Permissions Field
- Permission Types: r, w, x.
- File: see or copy.
- Dir: non-details shown.
- File: modified or overwritten
- Dir: requires execute.
- File: run as process.
- Dir: move dirs
8. Changing File Permissions
chmodchanges file/dir permissions, only by root or owner.
chmodcomes from change mode of access.
Two techniques of
- Symbolic: good changing one set of permissions at a time.
- Octal: good changing all permissions for users, groups, other.
chmod [<SET><ACTION><PERMISSIONS> FILE
./ 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.
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
x perm to
cp file and
w x perms on destination dir, both
~ will always have this.
11.1 Copying Files
dd [OPTIONS] OPERANDcopies 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
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
16. Network Configuration
lo loop back 127.0.0.1
17. Viewing Processes
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
- Search with
sudo apt-get install [package]
- Update system:
sudo apt-get update && upgrade
apt-get remove [package]and
apt-get purge [package]
19. Updating User Passwords
passwd [OPTIONS] [USER] updates user passwords.
-Sshows status info.
I/O redirection allows info from CL to be sent to file, device or other commands. Three file descripters:
- STDIN: Standard Input, information given to a command.
- STDOUT: Standard Out, information displays from output of command.
- 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
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!