My focus is on CALMS. I am building better understanding of DevOps as driver for the organization. I led the DevOps Academy at EPAM Systems Poland, where we were shaping new engineers to be professionals. Currently I am Cloud Solution Architect at Tameshi.
I am devoted to Serverless and CI/CD.” image=“https://storage.googleapis.com/killercoda-assets-europe1/meta/generated/pawelpiwosz.png?v=1775433600” sitename=“killercoda.com” favicon=“https://www.google.com/s2/favicons?domain=killercoda.com&sz=32” data-type=“bookmark”>
1. Syntax
Linux command is composed of the command and the argument
ls -l
- : one letter argument ex. l
-- : more than one letter argument ⇒ commonly in English words
-
each columns has different meanings
-
permissions
-
number of hard links
-
owner
-
group
-
file size in the bytes
-
date and time of
last modificationof the object -
file name
-
-
every arguments can be multiplied
-
In Linux filesystem,
the rootis the first point we can access. This root directory is represented by/symbol. On the top level of the filestytem is always/directory. -
absolute path / relative path
-
rootuser is the most powerful entity in the whole Linux system-
The home directory of the
rootuser is/root -
Other user’s home directories are under
/home
-
-
there’s a variable for the home path
cd $HOME/cd/cd ~
-
~= home directory -
*wild card ⇒ any string- ex.
ls my*file
- ex.
-
?any single character
root@ubuntu:~$ touch try1 try2 try01
root@ubuntu:~$ ls try*
try01 try1 try2
root@ubuntu:~$ ls try?
try1 try2
-
l (pipe)combine the commands-
command1 | command2 -
command1 | command2 | command3 -
⇒ The output of
command1is taken over as input tocommand2
-
-
>redirects all output from the left side of the sign, to the file on the right side of the sign-
ls -al > directorylist.txt -
notice-
if file doesn’t exist, create it
-
add content from redirected output
-
if file exists and it is not empty, clear the file and write the redirected output in empty file
-
-
-
>>add the output of the command on the end of existing content (only if there is any content in the fill)
2. times in Linux
atime : the last time when file was accessed
mtime : last modification time
ctime : last metadata modification time
ex. permissions change, location of the file, etc
3. basic commands
ls : show lists
-
ls -1shows lists in one line -
ls -afor hidden files -
ls -ldetailed list -
ls -Fwith/in the name of files -
ls -lafor various informations about the lists- permissions, ownership, size, modification date
-
ls -lhshows lists in order to the size -
ls -d * /show only the folders
clear : clear all window
- the same by running
/bin/echo -e "\x1b\x5b\x48\x1b\x5b\x32\x4a\c"
man : show a document for the command
mkdir : create directories
-
mkdir testdir{1..10}make directories from 1 to 10 -
mkdir -p parentdir/childdir{01..100}create parent directory
cd : short for Change Directory
pwd : show current work directory
rmdir : remove the directory
-
rmdir testdir{1..10}remove the directories from 1st to 19th -
can remove parent directory only when it is empty
-
works for files
-
-rgo recursively through directories and treat everything as file -
-fforce / do not ask ⇒ risky command
touch : create empty file
- or use
vim
grep : search for given pattern in the output
⇒ ex. grep case .bashrc : search for pattern case in a file .bashrc
wc : a utility for counting words, newlines, bytes.
wc -l .bashrccount how many lines are in.bashrcfile
sort sort the output in alphabetical order
-
uniqalways works beest withsort⇒sortis first -
⇒ ex.
cat numbers.txt | sort | uniq | wc -l