Ls -l длинный список в директории

Содержание

Слайд 2

ls --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 + - уменьшить”
уменьшить”

Слайд 3

~ представляет вашу домашнюю директорию
ls
ls -l
ls (команды не запоминаются)

~ представляет вашу домашнюю директорию ls ls -l ls (команды не запоминаются)

Слайд 4

ls -l Do
hit tab
двойной tab покажет вам список из чего

ls -l Do hit tab двойной tab покажет вам список из чего
можно выбрать, то что начинается с Do

Слайд 5

ls -l Do
hit tab
двойной tab покажет вам список из чего

ls -l Do hit tab двойной tab покажет вам список из чего
можно выбрать, то что начинается с Do

Слайд 6

ctrl + a курсор в начало команды
ctrl + e в конец
ctrl +

ctrl + a курсор в начало команды ctrl + e в конец
левая\правая стрелка передвигает курсор на одно слово
ctrl + u удаляет все до начала строки
ctrl +k до конца строки
ctrl + shift +c копировать в буфер
ctrl + shift +v вставить из буфера

Слайд 7

cd - change directory
cd Doc hit tab
pwd показывает где вы сейчас находитесь
cd

cd - change directory cd Doc hit tab pwd показывает где вы
Exercise Files > error >cd Exercise\ Files
ls -R departments
mkdir new_folder
rmdir new_folder (пустая папка)

Слайд 8

cp - 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
(rename)
mv departments/marketing/literature.txt .

Слайд 9

* - любое количество символов
? - один из символов
rm literature.txt (навсегда)
cp poems.txt

* - любое количество символов ? - один из символов rm literature.txt
poems3.txt
cp poems.txt poems4.txt
rm poems?.txt ->poems3 poems4 удалятся
rm рекурсивно
rm departments/customerservice -> error
rm -r departments/customerserivce

Слайд 10

rm -r departments/customerservice
find . -name "poe*"
find . -name "do*"
find . -name "d*"
find

rm -r departments/customerservice find . -name "poe*" find . -name "do*" find
. -name "*d*"
find ~/Documents -name "*d"

Слайд 11

change 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

Слайд 12

change permissions- chmod
symbolic
- : removes permission
+ : adds permission
= : adds permission

change permissions- chmod symbolic - : removes permission + : adds permission
and removes others
chmod u+rwx
chmod g=r
chmod 0-rwx

Слайд 13

change permissions- chmod
symbolic
- : removes permission
+ : adds permission
= : adds permission

change permissions- chmod symbolic - : removes permission + : adds permission
and removes others
chmod u+rwx
chmod g=r
chmod 0-rwx

Слайд 14

777 = 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,
u=rwx, g-rwx,o-rwx
./test.sh (chmod 755 test.sh)
ls -l

Слайд 15

777 = 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,
u=rwx, g-rwx,o-rwx
./test.sh (chmod 755 test.sh)
ls -l
./test.sh > Hello from the Test Script!

Слайд 16

chmod 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
test.sh
cat test.sh -> permissions denied
chmod 755 test.sh

Слайд 17

when user creates a file in the home directory it has 644

when user creates a file in the home directory it has 644
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

Слайд 18

in CL we use pipes to take output of one command and

in CL we use pipes to take output of one command and
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

Слайд 19

head 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
-n 5 poems.txt -> first five lines
cat poems.txt | cat -n | tail -5
cat poems.txt | tail - 5 | cat -n

Слайд 20

grep "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
poems.txt
grep -E "[hijk]" poems.txt
grep -E "\w{6,}" poems.txt

Слайд 21

grep "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
poems.txt
grep -E "[hijk]" poems.txt
grep -E "\w{6,}" poems.txt

Слайд 22

cat 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
-n
Name ID Team
Scott 314 Purple
Ananti 991 Orange
Jian 3127 Purple
Miguel 671 Green
Wes 1337 Orange
Anne 556 Green

Слайд 23

cat 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
simple_data.txt | tr [:lower:] [:upper:]

Слайд 24

tar -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
Files/
mkdir unpack1
mv myarchive.tar.bz2 unpack1/
cd unpack1/
tar -xf myarchive.tar.bz2
mkdir unpack2
tar -xf myarchives.tar.gz -C unpack2

Слайд 25

ls 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"
apt-get install

Слайд 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
>> users.txt

Слайд 27

Что такое Git?
Следит за изменениями в файлах и папках
Особенно за изменениями в

Что такое Git? Следит за изменениями в файлах и папках Особенно за
тексте
Система контроля версий
Программа управление исходным кодом

Слайд 28

Что такое Git?

Что такое Git?

Слайд 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

Слайд 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

Слайд 31

Настройка Git на Linux?
git config --global user.name “Your name”
git config

Настройка Git на Linux? git config --global user.name “Your name” git config
--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
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