Слайд 2ls --group-directories-first /var/log
ls -lah /usr/bin
“ctrl +shift + = увеличить шрифт”
“ctrl + -
![ls --group-directories-first /var/log ls -lah /usr/bin “ctrl +shift + = увеличить шрифт” “ctrl + - уменьшить”](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-1.jpg)
уменьшить”
Слайд 3~ представляет вашу домашнюю директорию
ls
ls -l
ls (команды не запоминаются)
![~ представляет вашу домашнюю директорию ls ls -l ls (команды не запоминаются)](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-2.jpg)
Слайд 4ls -l Do
hit tab
двойной tab покажет вам список из чего
![ls -l Do hit tab двойной tab покажет вам список из чего](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-3.jpg)
можно выбрать, то что начинается с Do
Слайд 5ls -l Do
hit tab
двойной tab покажет вам список из чего
![ls -l Do hit tab двойной tab покажет вам список из чего](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-4.jpg)
можно выбрать, то что начинается с Do
Слайд 6ctrl + a курсор в начало команды
ctrl + e в конец
ctrl +
![ctrl + a курсор в начало команды ctrl + e в конец](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-5.jpg)
левая\правая стрелка передвигает курсор на одно слово
ctrl + u удаляет все до начала строки
ctrl +k до конца строки
ctrl + shift +c копировать в буфер
ctrl + shift +v вставить из буфера
Слайд 7cd - change directory
cd Doc hit tab
pwd показывает где вы сейчас находитесь
cd
![cd - change directory cd Doc hit tab pwd показывает где вы](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-6.jpg)
Exercise Files > error >cd Exercise\ Files
ls -R departments
mkdir new_folder
rmdir new_folder (пустая папка)
Слайд 8cp - copy
cp poems.txt poems2.txt
cp simple_data.txt departments/hr/employee\ info/
mv poems2.txt department/marketing
mv department/marketing/poems2.txt departments/marketing/literature.txt
![cp - copy cp poems.txt poems2.txt cp simple_data.txt departments/hr/employee\ info/ mv poems2.txt](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-7.jpg)
(rename)
mv departments/marketing/literature.txt .
Слайд 9* - любое количество символов
? - один из символов
rm literature.txt (навсегда)
cp poems.txt
![* - любое количество символов ? - один из символов rm literature.txt](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-8.jpg)
poems3.txt
cp poems.txt poems4.txt
rm poems?.txt ->poems3 poems4 удалятся
rm рекурсивно
rm departments/customerservice -> error
rm -r departments/customerserivce
Слайд 10rm -r departments/customerservice
find . -name "poe*"
find . -name "do*"
find . -name "d*"
find
![rm -r departments/customerservice find . -name "poe*" find . -name "do*" find](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-9.jpg)
. -name "*d*"
find ~/Documents -name "*d"
Слайд 11change permissions- chmod
octal notations - 755, 777, 644
read -4
write -2
execute -1
![change permissions- chmod octal notations - 755, 777, 644 read -4 write -2 execute -1](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-10.jpg)
Слайд 12change permissions- chmod
symbolic
- : removes permission
+ : adds permission
= : adds permission
![change permissions- chmod symbolic - : removes permission + : adds permission](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-11.jpg)
and removes others
chmod u+rwx
chmod g=r
chmod 0-rwx
Слайд 13change permissions- chmod
symbolic
- : removes permission
+ : adds permission
= : adds permission
![change permissions- chmod symbolic - : removes permission + : adds permission](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-12.jpg)
and removes others
chmod u+rwx
chmod g=r
chmod 0-rwx
Слайд 14777 = a+rwx
755 = u+rwx, g=rx, o=rx
644 = u=rw, g=r, o=r
700 =
![777 = a+rwx 755 = u+rwx, g=rx, o=rx 644 = u=rw, g=r,](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-13.jpg)
u=rwx, g-rwx,o-rwx
./test.sh (chmod 755 test.sh)
ls -l
Слайд 15777 = a+rwx
755 = u+rwx, g=rx, o=rx
644 = u=rw, g=r, o=r
700 =
![777 = a+rwx 755 = u+rwx, g=rx, o=rx 644 = u=rw, g=r,](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-14.jpg)
u=rwx, g-rwx,o-rwx
./test.sh (chmod 755 test.sh)
ls -l
./test.sh > Hello from the Test Script!
Слайд 16chmod 644 test.sh
chmod a-x test.sh
./test.sh - > permissions denied
bash test.sh
cat test.sh
clear
chmod 244
![chmod 644 test.sh chmod a-x test.sh ./test.sh - > permissions denied bash](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-15.jpg)
test.sh
cat test.sh -> permissions denied
chmod 755 test.sh
Слайд 17when user creates a file in the home directory it has 644
![when user creates a file in the home directory it has 644](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-16.jpg)
permissions
touch newfile.txt
ls -lh -> check newfile permissions
vi test.sh
add comment: #line
sudo chown (change ownership) root test.sh
vi test.sh -> can't write into the file
Слайд 18in CL we use pipes to take output of one command and
![in CL we use pipes to take output of one command and](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-17.jpg)
send it to another command
echo "hello"
echo "hello" | wc -> 1 1 6
one line one word 6 characters there's additional invisible character \n
cat poems.txt
Слайд 19head poems.txt -> first 10 lines
tail poems.txt -> last 10 lines
-n option
head
![head poems.txt -> first 10 lines tail poems.txt -> last 10 lines](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-18.jpg)
-n 5 poems.txt -> first five lines
cat poems.txt | cat -n | tail -5
cat poems.txt | tail - 5 | cat -n
Слайд 20grep "the" poems.txt
grep -n "the" poems.txt
grep -i "the" poems.txt
grep -vi "the"
![grep "the" poems.txt grep -n "the" poems.txt grep -i "the" poems.txt grep](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-19.jpg)
poems.txt
grep -E "[hijk]" poems.txt
grep -E "\w{6,}" poems.txt
Слайд 21grep "the" poems.txt
grep -n "the" poems.txt
grep -i "the" poems.txt
grep -vi "the"
![grep "the" poems.txt grep -n "the" poems.txt grep -i "the" poems.txt grep](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-20.jpg)
poems.txt
grep -E "[hijk]" poems.txt
grep -E "\w{6,}" poems.txt
Слайд 22cat simple_data.txt
awk '{print $2}' simple_data.txt
awk '{print $2 "\t" $1}' simple_data.txt | sort
![cat simple_data.txt awk '{print $2}' simple_data.txt awk '{print $2 "\t" $1}' simple_data.txt](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-21.jpg)
-n
Name ID Team
Scott 314 Purple
Ananti 991 Orange
Jian 3127 Purple
Miguel 671 Green
Wes 1337 Orange
Anne 556 Green
Слайд 23cat simple_data.txt
sed s/Orange/Red/ simple_data.txt (subs)
cat simple_data.txt
sort simple_data.txt
cat dupes.txt
sort -u dupes.txt
rev simple_data.txt
tac simple_data.txt
cat
![cat simple_data.txt sed s/Orange/Red/ simple_data.txt (subs) cat simple_data.txt sort simple_data.txt cat dupes.txt](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-22.jpg)
simple_data.txt | tr [:lower:] [:upper:]
Слайд 24tar -cvf myarchive.tar Exercise\ Files/
tar -caf myarchive.tar.gz Exercise\ Files/
tar -caf myarchive.tar.bz2 Exercise\
![tar -cvf myarchive.tar Exercise\ Files/ tar -caf myarchive.tar.gz Exercise\ Files/ tar -caf](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-23.jpg)
Files/
mkdir unpack1
mv myarchive.tar.bz2 unpack1/
cd unpack1/
tar -xf myarchive.tar.bz2
mkdir unpack2
tar -xf myarchives.tar.gz -C unpack2
Слайд 25ls 1>filelist.txt
cat filelist.txt
ls > filelist2.txt
echo "and some appended text" >>filelist2.txt
sudo apt-get update
sudo
![ls 1>filelist.txt cat filelist.txt ls > filelist2.txt echo "and some appended text"](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-24.jpg)
Слайд 26
cat auth.log | grep "input_userauth_request" | awk '{print $9}' | sort -u
![cat auth.log | grep "input_userauth_request" | awk '{print $9}' | sort -u >> users.txt](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-25.jpg)
>> users.txt
Слайд 27Что такое Git?
Следит за изменениями в файлах и папках
Особенно за изменениями в
![Что такое Git? Следит за изменениями в файлах и папках Особенно за](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-26.jpg)
тексте
Система контроля версий
Программа управление исходным кодом
Слайд 29Как установить Git на Linux?
https://git-scm.com/download/linux
which git
git --version
![Как установить Git на Linux? https://git-scm.com/download/linux which git git --version](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-28.jpg)
Слайд 30 Настройка Git на Linux?
System
User
home
.gitconfig
Project
my_project/.git/gitconfig
git config --system
git config --global
git config
![Настройка Git на Linux? System User home .gitconfig Project my_project/.git/gitconfig git config](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-29.jpg)
Слайд 31 Настройка Git на Linux?
git config --global user.name “Your name”
git config
![Настройка Git на Linux? git config --global user.name “Your name” git config](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-30.jpg)
--global user.email “Your email”
git config --list ( to see your config)
git config user.name
git config user.email
cd ~
ls -la
cat .gitconfig
Слайд 32 Настройка Git на Linux?
git config --global core.editor “nano”
git config --global color.ui
![Настройка Git на Linux? git config --global core.editor “nano” git config --global](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-31.jpg)
true
curl -0l https://github.com/git/git/raw/master/contrib/completion/git-completion.bash
rename git-completion.bash to .git-completion.bash in home direcotyr
vi .bashrc
if [ -f ~/.git-completion.bash]; then
source ~/.git-completion.bash
fi
Слайд 33Инициализация репозитория
git init
Initialized empty git repository
![Инициализация репозитория git init Initialized empty git repository](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/949064/slide-32.jpg)