https://superuser.com/questions/453988/whats-the-difference-between-su-with-and-without-hyphen
#linux #su
#linux #su
Super User
What's the difference between "su" with and without hyphen?
I'm quite new to Linux terminal and I'm not quite sure what the difference between su with a hyphen and su without a hyphen is, for example: su - username vs. su username.
I looked into the documen...
I looked into the documen...
https://stackoverflow.com/questions/13032409/ssh-remote-variable-assignment
#linux #sysadmin #ssh #local_variable #variable_expansion #bashrc #export
#linux #sysadmin #ssh #local_variable #variable_expansion #bashrc #export
Stack Overflow
ssh remote variable assignment?
The following does not work for me:
ssh user@remote.server "k=5; echo $k;"
it just returns an empty line.
How can I assign a variable on a remote session (ssh)?
Note: My question is not about ...
ssh user@remote.server "k=5; echo $k;"
it just returns an empty line.
How can I assign a variable on a remote session (ssh)?
Note: My question is not about ...
In order to enable bash completion in Kubernetes you can usee the below command in linux bash:
Now to test this enter the below command and you should see the completion:
It should be expanded to
#linux #bash #shell #kubernetes #kubectl
source <(kubectl completion bash)
Now to test this enter the below command and you should see the completion:
kubectl cl<TAB>
It should be expanded to
kubectl cluster-info
.#linux #bash #shell #kubernetes #kubectl
Create a linux SWAP file:
https://linuxize.com/post/create-a-linux-swap-file/
#linux #swap #swapfile #swappiness #swapon #mkswap
https://linuxize.com/post/create-a-linux-swap-file/
#linux #swap #swapfile #swappiness #swapon #mkswap
Linuxize
Create a Linux Swap File
Swap is a space on a disk that is used when the amount of physical RAM memory is full. When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space.
In
you want to install network tools (like ping) you need to install
You can squash your image size even further by some tips. When you install a package, linux distros first download the package and put it in a cache folder. In
To tell the OS to delete the cache after installation you can provide
There are some package like
y using
Great job guys! You have reduced your alpine docker images so much :)
#docker #linux #alpine #apk #virtual #no_cache #apk_del #apk_add
Dockerfile`s some people in the community use `alpine
base image in order to reduce docker image size. apk
is its package management tool that can be used to install OS packages. So for example ifyou want to install network tools (like ping) you need to install
netcat-openbsd
:apk add netcat-openbsd
You can squash your image size even further by some tips. When you install a package, linux distros first download the package and put it in a cache folder. In
Alpine
it is located in /var/cache/apk
.To tell the OS to delete the cache after installation you can provide
--no-cache
option to it:apk add --no-cache netcat-openbsd
There are some package like
g++
or git
that is needed on installation of some other packages. After installation those packages is useless and just increase image size. You can remove those packages by using
--virtual
command:apk add --no-cache --virtual .build-deps g++ \
&& # do you stuff here \
&& apk del .build-deps
Great job guys! You have reduced your alpine docker images so much :)
#docker #linux #alpine #apk #virtual #no_cache #apk_del #apk_add
pdsh
: a high performance, parallel remote shell utility. Pdsh is a multithreaded remote shell client which executes commands on multiple remote hosts in parallel. Pdsh can use several different remote shell services, including standard "rsh", Kerberos IV, and ssh.To see more about it head over to:
- https://github.com/grondo/pdsh
#linux #shell #pdsh #shell
GitHub
GitHub - grondo/pdsh: A high performance, parallel remote shell utility
A high performance, parallel remote shell utility. Contribute to grondo/pdsh development by creating an account on GitHub.
How to copy a file in the same path with a different name?
Well you just need to use curly braces, {}, to make it happen:
What you usually MIGHT do:
You can take the smart path btw:
NOTE: if suffix of both files are different you can put that inside of curly braces too.
#linux #sysadmin #cp #copy #trick
Well you just need to use curly braces, {}, to make it happen:
What you usually MIGHT do:
cp /usr/local/share/lib/sample.conf /usr/local/share/lib/settings.conf
You can take the smart path btw:
cp /usr/local/share/lib/{sample,settings}.conf
NOTE: if suffix of both files are different you can put that inside of curly braces too.
#linux #sysadmin #cp #copy #trick
https://www.digitalocean.com/community/tutorials/using-grep-regular-expressions-to-search-for-text-patterns-in-linux
#linux #grep #regex
#linux #grep #regex
Digitalocean
Mastering grep with Regular Expressions: Guide for Efficient Text Search | DigitalOcean
Learn how to use grep with regular expressions to search, filter, and process text in Linux and Unix systems. This guide covers syntax, practical use cases, …