Compare commits
4 Commits
master
...
improve-na
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b98a84c13 | ||
|
|
91de63434f | ||
|
|
848ff0af5f | ||
|
|
fe95d770b9 |
@@ -1,16 +1,34 @@
|
||||
% compression
|
||||
|
||||
# Create a tar archive
|
||||
tar cf <name>.tar <files>
|
||||
tar -cvf <name>.tar <files>
|
||||
|
||||
# Create a tar archive (gz compression)
|
||||
tar -cvzf <name>.tar.gz <files>
|
||||
|
||||
# Create a tar archive (pigz compression)
|
||||
tar -I pigz -cvf <name>.tar.gz <files>
|
||||
|
||||
# Create a tar archive (bzip2 compression)
|
||||
tar -cvjf <name>.tar.bz2 <files>
|
||||
|
||||
# Create a tar archive (pbzip2 compression)
|
||||
tar -I pbzip2 -cvf <name>.tar.bz2 <files>
|
||||
|
||||
# Extract a tar archive
|
||||
tar xf <tar_file>
|
||||
tar -xf <tar_file>
|
||||
|
||||
# Create a tar archive with gz compression
|
||||
tar czf <name>.tar.gz <files>
|
||||
# Extract a tar (gz compression)
|
||||
tar -xzf <targz_file>
|
||||
|
||||
# Extract a tar using gz compression
|
||||
tar xzf <targz_file>
|
||||
# Extract a tar (pigz compression)
|
||||
tar -I pigz -xf <targz_file>
|
||||
|
||||
# Extract a tar (bzip2 compression)
|
||||
tar -xjf <tarbz2_file>
|
||||
|
||||
# Extract a tar (pbzip2 compression)
|
||||
tar -I pbzip2 -xf <tarbz2_file>
|
||||
|
||||
# Create a gz archive
|
||||
gzip -9 -c <files> > <name>.gz
|
||||
@@ -21,4 +39,5 @@ gzip -d <gz_file>
|
||||
$ files: ls | awk -F: '{ print $1}'
|
||||
$ tar_file: ls *.tar | awk -F: '{ print $1}'
|
||||
$ targz_file: ls *.tar.gz | awk -F: '{ print $1}'
|
||||
$ tarbz2_file: ls *.tar.bz2 | awk -F: '{ print $1}'
|
||||
$ gz_file: ls *.gz | awk -F: '{ print $1}'
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
% docker-compose
|
||||
|
||||
# Build a compose YAML
|
||||
sudo docker compose -f <file> build
|
||||
|
||||
# Up a compose YAML
|
||||
sudo docker compose -f <file> up
|
||||
|
||||
@@ -12,10 +15,25 @@ sudo docker compose -f <file> up -d --force-recreate
|
||||
# Down a compose YAML
|
||||
sudo docker compose -f <file> down
|
||||
|
||||
# Print the last lines of compose YAML logs
|
||||
# Execute command in a compose YAML
|
||||
sudo docker compose -f <file> exec <service> <command>
|
||||
|
||||
# Print logs of a compose YAML
|
||||
sudo docker compose -f <file> logs --tail 100
|
||||
|
||||
# Print the last lines of compose YAML logs and following its logs
|
||||
# Print service logs of a compose YAML
|
||||
sudo docker compose -f <file> logs --tail 100 <service>
|
||||
|
||||
# Print and follow logs of a compose YAML
|
||||
sudo docker compose -f <file> logs --tail 100 -f
|
||||
|
||||
# Print and follow logs of a compose YAML
|
||||
sudo docker compose -f <file> logs --tail 100 -f <service>
|
||||
|
||||
# Remove volume of a compose YAML
|
||||
sudo docker volume rm <dir>_<volume>
|
||||
|
||||
$ dir: basename $PWD
|
||||
$ file: ls *.yaml | awk '{print $1}'
|
||||
$ volume: sudo docker compose -f <file> config --volumes | awk '{print $1}'
|
||||
$ service: sudo docker compose -f <file> config --services | awk '{print $1}'
|
||||
|
||||
@@ -14,11 +14,11 @@ $ volume: sudo docker volume ls --format "{{.Name}}" | awk '{print $1}'
|
||||
# Create new network
|
||||
docker network create <name>
|
||||
|
||||
# List the networks
|
||||
# List all networks
|
||||
sudo docker network ls
|
||||
|
||||
# Remove volume
|
||||
sudo docker volume rm <network>
|
||||
# Remove network
|
||||
sudo docker network rm <network>
|
||||
|
||||
$ network: sudo docker network ls --format "{{.Name}}" | awk '{print $1}'
|
||||
|
||||
|
||||
@@ -54,12 +54,18 @@ meld <(hexdump -C <file_1>) <(hexdump -C <file_2>)
|
||||
# Compare 2 files (bcompare)
|
||||
bcompare <file_1> <file_2>
|
||||
|
||||
# Replace expression in files
|
||||
ack -rl "<expression>" | xargs sed -i 's#<expression>#<replace_expression>#g'
|
||||
# Replace expression in files (ack)
|
||||
ack -rl '<expression>' | xargs sed -i 's#<expression>#<replace_expression>#g'
|
||||
|
||||
# Replace expression in files (rg)
|
||||
rg -l '<expression>' | xargs sed -i 's#<expression>#<replace_expression>#g'
|
||||
|
||||
# Disable Bluetooth ERTM
|
||||
sudo bash -c "echo Y > /sys/module/bluetooth/parameters/disable_ertm"
|
||||
|
||||
# Show disk usage
|
||||
df -h
|
||||
|
||||
$ user: cat /etc/passwd | awk -F: '{ print $1}'
|
||||
$ group: cat /etc/group | awk -F: '{ print $1}'
|
||||
$ interface: ip link | grep "^[0-9]*:" | sed "s/[0-9]*: \(.*\):.*/\1/" | awk -F: '{ print $1}'
|
||||
|
||||
Reference in New Issue
Block a user