A collection of most commonly used Linux commands & tools, articles, & settings.
Edit this file using dconfeditor
org/gnome/gnome-screenshot/auto-save-directory --> "file:///home/talha/Pictures/ScreenShots/"
gsettings set org.gnome.gnome-screenshot auto-save-directory "file:///home/$USER/Pictures/ScreenShots/"
how-to-customize-dock-panel-on-ubuntu
sudo apt install dconf-editor
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode FIXED
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 64
gsettings set org.gnome.shell.extensions.dash-to-dock unity-backlit-items true
sudo adduser user
sudo usermod -a -G sudo user
sudo apt install vlc vlc-plugin-fluidsynth
1st Run this command in your terminal: cvt 3840 2160
for 4K
in this case (Change the Res Accordingly).
Then copy the output on 2nd line after Modeline.
Below is an exaple output
╭─talha@Manjaro in ~
╰─λ cvt 3840 2160
# 3840x2160 59.98 Hz (CVT 8.29M9) hsync: 134.18 kHz; pclk: 712.75 MHz
Modeline "3840x2160_60.00" 712.75 3840 4160 4576 5312 2160 2163 2168 2237 -hsync +vsync
╭─talha@Manjaro in ~ via v3.10.9 took 48ms
╰─λ
eDP-1
is - in my - case - the Primary Monitor name, which can be found using xrandr
command. Find yours by just typing xrand
in your terminal...
Here's an example:
And then use these commands, replace eDP-1
with your monitor name :
xrandr --newmode "3840x2160_60.00" 712.75 3840 4160 4576 5312 2160 2163 2168 2237 -hsync +vsync
xrandr --addmode eDP-1 3840x2160_60.00
To use the new resolution:
xrandr -s 3840x2160_60.00
To take low compression, high quality screenshots, type:
scrot -q 100 -d 3
find . -type f -exec du -h {} \; | sort -h
Reverse the sort order with -r
i.e. larger files first:
find . -type f -exec du -h {} \; | sort -hr
8. Find the size of all hidden files and directories (dot files & dirs) & sort them wrt size:
Dot directories are usually found in the $HOME (~)
folder and are hidden by default...
find . -maxdepth 1 -type d -iname ".*" -exec du -sh {} \; | sort -h
ps -fu $USER | awk '{print "kill -9 " $2}' | sh
OR
killall -u $USER
To create a simple tar file from a given dir use:
tar -cf Pictures.tar Pictures/
To extract a tar file:
tar -xf Pictures.tar
For verbose output, use -v
option:
tar -cvf Pictures.tar Pictures/
tar -xvf Pictures.tar
-c
: create-x
: Extract (the oposite of create)-f
: specify a filename (comes always at the end)-v
: verbose output-z
: compress withgzip
(Create.tar.gz
files-j
: compress withbzip2
(Create.tar.gz2
files)-J
: compress withxz
(Create.tar.xz
files)-t
: list contents of archive
To create a .tar.gz file:
tar -czf Pictures.tar.gz Pictures/
To extract a .tar.gz file:
tar -xzf Pictures.tar.gz Pictures/
To create a .tar.gz2 file:
tar -cjf Pictures.tar.gz2 Pictures/
To extract a .tar.gz file:
tar -xjf Pictures.tar.gz2 Pictures/
To create a .tar.xz file:
tar -cJf Pictures.tar.xz Pictures/
To extract a .tar.xz file:
tar -xJf Pictures.tar.xz Pictures/
Use Multi-Threading to Creacte/Extract tarballs:
To use all the resourses to speed up the process we can (in BASH):
XZ_DEFAULTS="--threads=4"; export XZ_DEFAULTS;
tar -cJvf archive.tar.xz Pictures/
or in ZSH:
set XZ_DEFAULTS "--threads=4"; export XZ_DEFAULTS;
Or we can provide -I, --use-compress-program=PROG
option to use a given compression program instead of default gzip, bzip2 or xz programs:
pigz
, pbzip2
& pxz
are the PARALLEL
Implementaions of the gzip
, pbzip2
, & xz
respectively.
These can be installed using apt in Ubuntu:
sudo apt install pigz pbzip2 pxz
Which are just the PARALLEL implementations of the given programs (Parallel Implementation of gzip, pbzip2, & xz)
If you're using Ubuntu 20.04, the pxz program is not available in default repos. So you can add bionic (Ubuntu 18.04) main universe repo to install this program:
sudo apt edit-sources
And then add this line at the end of the file:
deb http://cz.archive.ubuntu.com/ubuntu bionic main universe
Then install the pxz
program:
sudo apt install pxz
To use these programs instead of defaults we can provode flags like this:
tar -I pxz -cvf Pictures.tar.xz Pictures/
tar -I pigz Pictures.tar.gz Pictrures/
tar -I pbzip2 Pictures.tar.gz2 Pictrures/
Or even we can provide default gz option with additional flags:
-9
means compression level 9 (maximum compression)
tar -c -I 'xz -9' -f archive.tar.xz Dir/
-T0
means to use all the available threads (I Tried but it does not work, so instead pxz
is recomended)
tar -c -I 'xz -9 -T0' -f archive.tar.xz Dir/
One-liner to create a .tar.xz file with 4 Threads to speed up:
XZ_DEFAULTS="--threads=4"; export XZ_DEFAULTS; tar -cJf Pictures.tar.xz Pictures/
OR:
tar -I pxz -cf Pictures.tar.xz Pictures/
From Server:
sudo lsof -i -n | egrep '\<sshd\>'
From client:
sudo lsof -i -n | egrep '\<ssh\>'
sudo lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT,FSUSED,FSUSE%,FSAVAIL /dev/sda /dev/sdb
gpg --symmetric --cipher-algo AES256 <FILE.txt>
gpg -d FILE.txt.gpg > FILE.txt