Archive for the ‘linux’ Category

Find files owned by specific user

find /path -user www-data -print

Find and rename files uppercase to lowercase

find my_folder -depth -exec rename ‘s/(.*)\/([^\/]*)/$1\/\L$2/’ {} \; Find my pattern and rename find ./ -type f -name ‘*_en-gb.json’ -exec sh -c ‘mv "$0" "${0%_en-gb.json}_en-uk.json"’ {} \;

Read the content of zip archive without extraction

unzip -l archive.zip

Run command on Ubuntu startup as superuser

vi /etc/rc.local

Dig to query specific dns server

dig mydomain.com @ns.myserver.com

How to find package by filename

user@laptop:/var/www# dpkg -S /usr/bin/firefox diversion by firefox-mozilla-build from: /usr/bin/firefox diversion by firefox-mozilla-build to: /usr/bin/firefox.ubuntu firefox-mozilla-build: /usr/bin/firefox user@laptop:/var/www# apt-get remove firefox-mozilla-build

Ubuntu keyboard layout change

[Ctrl] + [Super] + [Space] Super: on some keyboards it has Windows logo

Ubuntu monitor configuration filename

$HOME/.config/monitors.xml Example: <monitors version="1"> <configuration> <clone>no</clone> <output name="eDP-1"> <vendor>BOE</vendor> <product>0x0653</product> <serial>0x00000000</serial> <width>1920</width> <height>1080</height> <rate>60</rate> <x>3840</x> <y>0</y> <rotation>normal</rotation> <reflect_x>no</reflect_x> <reflect_y>no</reflect_y> <primary>no</primary> </output> <output name="DP-1"> <vendor>BNQ</vendor> <product>0x8016</product> <serial>0x00005445</serial> <width>1920</width> <height>1080</height> <rate>60</rate> <x>1920</x> <y>0</y> <rotation>normal</rotation> <reflect_x>no</reflect_x> <reflect_y>no</reflect_y> <primary>yes</primary> </output> </configuration> </monitors>

Ubuntu Skype enable group chat

/msnp24 simply need to cope and past to someone that is not online in the chat then restart the skype and you are done

Ubuntu using Lxrandr to position second monitor

lxrandr saves configuration to: /home/imran/.config/autostart/lxrandr.desktop sample: [Desktop Entry] Type=Application Exec=xrandr –output HDMI1 –mode 1920×1080 –rate 60.00 –output eDP1 –mode 1920×1080 –rate 60.00 –left-of HDMI1 Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name[en_GB]=LXRandR Name=LXRandR Comment[en_GB]=To keep laptop on the left handside with monitor in the center Comment=To keep laptop on the left handside with monitor in the center imran@imran-Lenovo-Z51-70:~/.config/autostart$