Read or watch:
- What Is The Shell?
- Navigation
- Looking Around
- A Guided Tour
- Manipulating Files
- Working With Commands
- Reading Man pages
- Keyboard shortcuts for Bash
- LTS
- Shebang
man or help:
- cd
- ls
- pwd
- less
- file
- ln
- cp
- mv
- rm
- mkdir
- type
- which
- help
- man
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
- What does RTFM mean?
- What is a Shebang
- What is the shell
- What is the difference between a terminal and a shell
- What is the shell prompt
- How to use the history (the basics)
- What do the commands or built-ins
cd
,pwd
,ls
do - How to navigate the filesystem
- What are the . and .. directories
- What is the working directory, how to print it and how to change it
- What is the root directory
- What is the home directory, and how to go there
- What is the difference between the root directory and the home directory of the user root
- What are the characteristics of hidden files and how to list them
- What does the command
cd -
do
- What do the commands
ls
,less
,file
do - How do you use options and arguments with commands
- Understand the ls long format and how to display it
- A Guided Tour
- What does the
ln
command do - What do you find in the most common/important directories
- What is a symbolic link
- What is a hard link
- What is the difference between a hard link and a symbolic link
- What do the commands
cp
,mv
,rm
,mkdir
do - What are wildcards and how do they work
- How to use wildcards
- What do
type
,which
,help
,man
commands do - What are the different kinds of commands
- What is an alias
- When do you use the command help instead of man
- How to read a man page
- What are man page sections
- What are the section numbers for User commands, System calls and Library functions
- Common shortcuts for Bash
- What does
LTS
mean?
- Allowed editors:
vi
,vim
,emacs
- All your scripts will be tested on Ubuntu 14.04 LTS
- All your scripts should be exactly two lines long (
$ wc -l file
should print 2) - All your files should end with a new line (why?)
- The first line of all your files should be exactly
#!/bin/bash
- A README.md file at the root of the
holberton-system_engineering-devops
repo, containing a description of the repository - A
README.md
file, at the root of the folder of this project, describing what each script is doing - You are not allowed to use backticks,
&&
,||
or;
- All your scripts must be executable. To make your file executable, use the
chmod
command:chmod u+x file
. Later, well learn more about how to utilize this command.
Example of line count and first line
julien@ubuntu:/tmp$ wc -l 12-file_type
2 12-file_type
julien@ubuntu:/tmp$ head -n 1 12-file_type
#!/bin/bash
julien@ubuntu:/tmp$
In order to test your scripts, you will need to use this command: chmod u+x file
. We will see later what does chmod
mean and do, but you can have a look at man chmod
if you are curious.
Example
julien@ubuntu:/tmp$ ls
12-file_type
lll
julien@ubuntu:/tmp$ ls -la lll
-rw-rw-r-- 1 julien julien 15 Sep 19 21:05 lll
julien@ubuntu:/tmp$ cat lll
#!/bin/bash
ls
julien@ubuntu:/tmp$ ls -l lll
-rw-rw-r-- 1 julien julien 15 Sep 19 21:05 lll
julien@ubuntu:/tmp$ chmod u+x lll # you do not have to understand this yet
julien@ubuntu:/tmp$ ls -l lll
-rwxrw-r-- 1 julien julien 15 Sep 19 21:05 lll
julien@ubuntu:/tmp$ ./lll
12-file_type
lll
julien@ubuntu:/tmp$
Read or watch:
man or help:
- chmod
- sudo
- su
- chown
- chgrp
- id
- groups
- whoami
- adduser
- useradd
- addgroup
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
- What do the commands
chmod
,sudo
,su
,chown
,chgrp
do - Linux file permissions
- How to represent each of the three sets of permissions (owner, group, and other) as a single digit
- How to change permissions, owner and group of a file
- Why cant a normal user
chown
a file - How to run a command with root privileges
- How to change user ID or become superuser
- How to create a user
- How to create a group
- How to print real and effective user and group IDs
- How to print the groups a user is in
- How to print the effective userid
- Allowed editors:
vi
,vim
,emacs
- All your scripts will be tested on Ubuntu 14.04 LTS
- All your scripts should be exactly two lines long (
$ wc -l file
should print 2) - All your files should end with a new line (why?)
- The first line of all your files should be exactly
#!/bin/bash
- A
README.md
file, at the root of the folder of the project, describing what each script is doing - You are not allowed to use backticks,
&&
,||
or;
- All your files must be executable
Read or watch:
man or help:
- echo
- cat
- head
- tail
- find
- wc
- sort
- uniq
- grep
- tr
- rev
- cut
- passwd (5) (i.e. man 5 passwd)
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
- What do the commands
head
,tail
,find
,wc
,sort
,uniq
,grep
,tr
do - How to redirect standard output to a file
- How to get standard input from a file instead of the keyboard
- How to send the output from one program to the input of another program
- How to combine commands and filters with redirections
- What are special characters
- Understand what do the white spaces, single quotes, double quotes, backslash, comment, pipe, command separator, tilde and how and when to use them
- How to display a line of text
- How to concatenate files and print on the standard output
- How to reverse a string
- How to remove sections from each line of files
- What is the
/etc/passwd
file and what is its format - What is the
/etc/shadow
file and what is its format
- Allowed editors:
vi
,vim
,emacs
- All your scripts will be tested on Ubuntu 14.04 LTS
- All your scripts should be exactly two lines long (
$ wc -l file
should print 2) - All your files should end with a new line (why?)
- The first line of all your files should be exactly #!/bin/bash
- A
README.md
file, at the root of the folder of the project, describing what each script is doing - You are not allowed to use backticks,
&&
,||
or;
- All your files must be executable
- You are not allowed to use
sed
orawk
Read your /etc/passwd
and /etc/shadow
files.
Note: You do not have to learn about fmt
, pr
, du
, gzip
, tar
, lpr
, sed
and awk
yet.
Read or watch:
- Expansions
- Shell Arithmetic
- Variables
- Shell initialization files
- The alias Command
- Technical Writing
man or help:
- printenv
- set
- unset
- export
- alias
- unalias
- .
- source
- printf
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
- What happens when you type
$ ls -l *.txt
- What are the
/etc/profile
file and the/etc/profile.d
directory - What is the
~/.bashrc
file
- What is the difference between a local and a global variable
- What is a reserved variable
- How to create, update and delete shell variables
- What are the roles of the following reserved variables: HOME, PATH, PS1
- What are special parameters
- What is the special parameter
$?
?
- What is expansion and how to use them
- What is the difference between single and double quotes and how to use them properly
- How to do command substitution with
$()
and backticks
- How to perform arithmetic operations with the shell
- How to create an alias
- How to list aliases
- How to temporarily disable an alias
- How to execute commands from a file in the current shell
- Allowed editors:
vi
,vim
,emacs
- All your scripts will be tested on Ubuntu 14.04 LTS
- All your scripts should be exactly two lines long (
$ wc -l file
should print 2) - All your files should end with a new line (why?)
- The first line of all your files should be exactly
#!/bin/bash
- A
README.md
file, at the root of the folder of the project, describing what each script is doing - You are not allowed to use
&&
,||
or;
- You are not allowed to use
bc
,sed
orawk
- All your files must be executable
Read your /etc/profile
, /etc/inputrc
and ~/.bashrc
files.
Look at some files in the /etc/profile.d
directory.
Note: You do not have to learn about awk
, tar
, bzip2
, date
, scp
, ulimit
, umask
, or shell scripting, yet.
It is your responsibility to request a review for your blog from a peer before the projects deadline. If no peers have been reviewed, you should request a review from a TA or staff member.
This project is about basic shell scripting below the learning obejctives are listed for this project
Learning Objectives
- How to create SSH keys
- What is the advantage of using
#!/usr/bin/env
bash over#!/bin/bash
- How to use
while
,until
andfor
loops - How to use
if
,else
,elif
andcase
condition statements - How to use the
cut
command - What are files and other comparison operators, and how to use them