Ubuntu Commands
Common Ubuntu Commands for quick referenceUpdated 6 months ago
Open All
Fix Upgrade Errors
Rename a batch of pics:
cd /
cd home/adam/Desktop/new_pics/1-to_sort/dylan
rename 's/.JPG$/.jpg/' *.JPG
rename 's//1980s- /' *.jpg
rename 's/-flag//' *.png
rename 's/(\.*)/Vegas- $1/' *.jpg
rename -nono proofreads your command
rename 's/.+/our $i; sprintf("TattersalForSale%d.jpg", 1+$i++)/e' *
Update:
sudo apt-get dist-upgrade
update-manager âd
sudo apt-get update
Reinstall "Files" or Nautilus:
sudo apt-get purge nautilus
sudo apt-get install nautilus
Resize a batch of pics:
convert '*.jpg[200x]' resized%03d.jpg
Startup Beautifully:
Startup Applications. Make Entries for:
nautilus /home/adam/Downloads/
filezilla -c "0/adamwithers.ca"
firefox
UnInstall Something:
dpkg --list
sudo apt-get --purge remove franz
Disable Password Keyring:
Open "Password and Encryption keys"
Under login, select approriate keys
Set Password to Blank
Remember to close before resetting!
Was
Remove a PPA:
sudo add-apt-repository --remove ppa:dhor/myway
Gimp:
How to install GIMP without that stupid being unable to open /tmp/ folder!!!
sudo add-apt-repository ppa:otto-kesselgulasch/gimp
sudo apt update
sudo apt install gimp
FileZilla File Association:
/usr/bin/gimp-2.10
WebP need Version 2.10.x
Can't Crop? Selection tool on Rectangle SUBTRACT not Replace / SELECT
Selecting Tools: Foreground Select Tool, and Scissors. Than an inverted mask
/home/adam/snap/gimp/281/.config/GIMP/2.10/gimprc
/snap/bin/gimp Opening "/tmp/fz3temp-2/502 Discovery St..jpg" failed: Could not open "/tmp/fz3temp-2/502 Discovery St..jpg" for reading: No such file or directory
Install .Run File:
sudo chmod +x ./LightBurn-Linux64-v0.9.20.run
./LightBurn-Linux64-v0.9.20.run
USB drive not working:
df -Th
umount /media//
ie. umount /dev/sdb1
sudo dosfsck -a /dev/
sudo dosfsck -a /dev/sdb1
USB drive no Permissions:
sudo mkdir -p /media/USB32GB
sudo mount -t ext4 -o rw /dev/sdb2 /media/USB32GB
sudo chown -R adam:adam /media/USB32GB
USB drive running slow:
unmount
sudo modprobe ehci_hcd
Inkscape:
sudo add-apt-repository universe
sudo add-apt-repository ppa:inkscape.dev/stable
sudo apt-get update
sudo apt install inkscape
Gimp Wont Load:
Install This Package:
http://security.ubuntu.com/ubuntu/pool/main/g/gdk-pixbuf/libgdk-pixbuf2.0-0_2.32.2-1ubuntu1.6_amd64.deb
~$ sudo apt-get update
sudo gedit /etc/apt/sources.list
Add This line:
deb http://security.ubuntu.com/ubuntu xenial-security main.
"6to4 is deprecated" Error:
Upgrade your routers' firmware!
https://thenewstack.io/tayga-bridge-an-ipv6-network-back-to-ipv4-using-nat64/
iPhone Pic Connecting
Open the iDevices Documents folder in Nautilus.
Press CTRL+L to get the real address which will look like afc://YOURSERIAL:3/
Remove trailing colon and number and press ENTER (i.e. it should just read afc://YOURSERIAL)
Graphics Card Drivers: GeForce GTX 750 Ti
https://www.nvidia.ca/Download/driverResults.aspx/73666/en-us
But it said I would have to disable the Nouveau Driver. Should i?
GEdit Session Saver
Download+Extract this: https://github.com/dsoprea/GeditSafetySave
sudo cp Downloads/GeditSafetySave-master /usr/share/gedit/plugins -r
Make sure it shows up in GEdit->Preferences->Plugins
You might have to:
sudo chmod 777 /usr/share/gedit/plugins
sudo chown adam /usr/share/gedit/plugins
Repair System:
fsck /dev/sda1
sudo fsck /dev/sda5
Batch Convert Images:
// Set JPEG quality
for file in *.jpg; do gm convert -quality 90 "$file" "out_${file// / }"; done
// Add Text
for file in *.jpg; do gm convert -font helvetica -fill blue -draw "text 100,100 Cockatoo""$file" "out_${file// / }"; done
// Tile image
for file in *.jpg; do gm convert -size 640x480 tile:bumps.jpg "$file" "out_${file// / }"; done
// Make charcoal drawing
for file in *.jpg; do gm convert -charcoal 6 "$file" "out_${file// / }"; done
//Resize to certain Size
for file in *.jpg; do gm convert -resize 1200x800 "$file" "out_${file// / }"; done
If on Startup you can't login:
Boot in recovery mode.
Run FCSK, then clean, then .... the other one :)
Show all your Harware + Temperatures Etc.
sudo apt install inxi
inxi -F
Show Your Current Kernel Version:
uname -r
Unable to locate package:
https://packages.ubuntu.com/
Search for your file
Download ".deb" from any source
PHP/Apaches DocumentRoot is set in:
/etc/apache2/sites-enabled/000-default.conf
DocumentRoot = "/var/www/"
Install LAMP in Ubuntu:
sudo apt-get install lamp-server^
sudo apt-get update
php -v
sudo /etc/init.d/apache2 restart
chmod 777 /var/www/
sudo apt-get install php5.6
sudo apt-get install php7.0 php7.0-mcrypt
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0-gd
IPCONFIG:
nmcli dev status
nmcli dev show eth0
"Authentication Required" popup stuck:
Press ALT+F2
Type "r" and press enter
Windows File Sharing:
/etc/samba/smb.conf
usershare owner only = false
You may need to add to /etc/samba/smb.conf: "usershare owner only= false"
Turn off Resume Restore on Firefox crash:
In the Location bar, type about:config and press Enter.
The about:config "This might void your warranty!" warning page may appear. Click "I'll be careful, I promise!" to continue to the about:config page.
In the Search box at the top, type browser.sessionstore.resume_from_crash.
In the resulting grid, double-click on browser.sessionstore.resume_from_crash to set it to false.
Set Firefox to load in FULL screen on power on.:
In Firefox, go to the preferences: about:config
The about:config "This might void your warranty!" warning page may appear. Click "I'll be careful, I promise!" to continue to the about:config page.
Set this to false: full-screen-api.approval-required
Next you have to change the startup script to request full screen
Startup with Firefox Fullscreen
firefox -url http://localhost/preview.php ;
sleep 5 ;
xdotool key F11;
Ad Blocking:
https://getadblock.com/
https://www.i-dont-care-about-cookies.eu/
https://addons.mozilla.org/en-CA/firefox/addon/adblock-for-youtube/
Clear Cache + Remove Thumbnails:
Use "Disk Usage Analyser"
sudo apt-get autoremove
sudo apt-get autoremove --purge
sudo apt-get autoclean
sudo rm /var/log/*.gz *.1 *.old
Delete Files in /var/lib/snapd/cache/
BleachBit
stacer
rm -r ~/.cache/thumbnails
rm -r ~/.thumbnails
Create USB Boot Installer:
wget https://mirrors.switch.ca/ubuntu-releases/20.04.1/ubuntu-20.04.1-desktop-amd64.iso
Video Driver Display Problems:
sudo apt-get update
sudo apt install unity-control-center
unity-control-center
Aug 2023
sudo apt install nvidia-driver-525 nvidia-dkms-525
You will need to do the MOK Key thing+password
Multi Monitors Add-On:
This extension puts the time on each monitor
Beep:
sudo apt install beep
sudo modprobe pcspkr
beep
List Apps, for Delettion:
dpkg --get-selections > list.txt
dpkg-query -W --showformat='${Installed-Size;10}\t${Package}\n' | sort -k1,1n
sudo apt-get purge YYYYYYYYYYYY
I deleted rstudio, thunderbird, skypeforlinux
If the Trash breaks:
Rename, then delete the new: ~/.local/share/Trash
Write to File:
someCommand > someFile.txt
someCommand >> someFile.txt # append
someCommand &> someFile.txt #get Errors
someCommand &>> someFile.txt # append errors
Startup Commands
In NEW versions of Ubuntu, use the "Startup Applications" Program!
OR
sudo nano /etc/rc.local
OR
sudo nano ~/config/upstart/HERE!
OR
sudo nano /home/.profile
You may need this!! export DISPLAY=:0
crontab -e
@reboot export DISPLAY=:0; && firefox
Chrome Fullscreen
OR
chromium --start-fullscreen localhost --password-store=basic --incognito
Schedule A Beep every minute(Testing CronJob):
EDITOR="gedit" crontab -e
*/1 * * * * beep
Scheduled Screen On. Screen Off
EDITOR="gedit" crontab -e
57 2 * * * sleep 3 && xset -display :0.0 dpms force off && gnome-screensaver-command -i;beep
58 2 * * * sleep 3 && xset -display :0.0 dpms force on && gnome-screensaver-command -i;beep
Disable Mouse/Keyboard
xinput list
xinput set-prop 12 "Device Enabled" 0
xinput set-prop 12 "Device Enabled" 1
Task Manager
gnome-system-monitor
Debug Network Connection:
For Hard-wired Ethernet Connection Bugs
Under Network Menu.
Edit Connections
Create a new Ethernet Connection
List Hard Drives:
sudo lshw -class disk -short
Install LAMP
sudo apt-get install -y apache2
sudo apt-get install -y mysql-server
sudo apt-get install -y php5 libapache2-mod-php5 php5-curl
sudo /etc/init.d/apache2 restart
http://localhost/
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
Fix Sound
sudo gedit /etc/pulse/daemon.conf
Add this line:
src-sinc-best-quality
OR (Jan 2019)
sudo apt remove --purge alsa-base pulseaudio
sudo apt install alsa-base pulseaudio
OR (Oct 2019)
sudo gedit /etc/modprobe.d/alsa-base.conf
Add: this line:
options snd-hda-intel model=generic
Restart
Oct 2019
If not showing up Card not Sound Details
sudo apt remove --purge alsa-base pulseaudio
sudo apt install alsa-base pulseaudio
and RESTART!!
Connect to IPhone
Open the iDevices Documents folder in Nautilus.
Press CTRL+L to get the real address which will look like afc://YOURSERIAL:3/
Remove trailing colon and number and press ENTER (i.e. it should just read afc://YOURSERIAL)
My VPN: Windscribe
https://windscribe.com/myaccount
echo 'deb https://repo.windscribe.com/ubuntu zesty main' | sudo tee /etc/apt/sources.list.d/windscribe-repo.list
sudo apt-get install windscribe-cli
windscribe login: adamwithers
windscribe connect Amsterdam
windscribe disconnect
Disable Emoji Menu
ibus-setup
"Emoji" tab
Three-dot menu
Delete CTRL-SHIFT-e shortcut
Screenshot doesn't work
In Settings->Keyboard->Custom Shortcut
Command: gnome-screenshot -w
If it still doesn't work, you have to disable Magic-sysrq:
UNTESTED!!!
sudo sysctl -w kernel.sysrq=1
Fix Internet:
Click the "adam jan 2018" in top menu
Remote Desktop:
Remmina
Unified Remote urServer:
if http://localhost:9510/ say "not Found"....
Go to ~/opt/urserver/
http://localhost:9510/web/
Restart Server
Terminal /opt/urserver/urserver
To Update EXIF date:
connect to FTP in Command prompt.
cd /whatever
site UTIME somefile.txt 20150331122000 20150331122000 20150331122000 UTC
Screen Recorder:
simplescreenrecorder
Exfat Error:
sudo add-apt-repository universe
sudo apt update
sudo apt install exfat-fuse exfat-utils
Upgrade Ubuntu:
sudo apt-get update
sudo apt dist-upgrade
Sleep Computer:
systemctl suspend
MemTest:
sudo apt install memtester
sudo memtester size iteration
sudo memtester 200M 1
WEBP+HEIF Thumbnails:
2020 Solution
Confirm you have a file named like /usr/bin/convert-im6.q16
sudo gedit /usr/share/thumbnailers/webp.thumbnailer
[Thumbnailer Entry]
Exec=/usr/bin/convert-im6.q16 -thumbnail %s %i %o
MimeType=image/x-webp;image/webp;image/x-dds;
sudo gedit /usr/share/thumbnailers/webp.thumbnailer
[Thumbnailer Entry]
Exec=/usr/bin/dwebp %i -scale 100 100 -o %o
MimeType=image/x-webp;image/webp;
sudo apt-get install webp
HEIF Thumnails
sudo apt-get install heif-thumbnailer
WEBP Viewing:
sudo add-apt-repository ppa:krifa75/eog-ordissimo
sudo apt update
sudo apt install webp-pixbuf-loader
Dump Zeitgeist:
sudo apt-get --purge autoremove activity-log-manager-common activity-log-manager-control-center zeitgeist zeitgeist-core zeitgeist-datahub
sudo rm -fr {/root,/home/*}/.local/share/zeitgeist
MTML5 video not working:
sudo apt install ffmpeg
AVIF Files:
sudo apt install gthumb
Fix UrServer:
Feb 2020: Just use KDE Connect
Delete or Rename ~/.urserver/ folder
New Instructions Oct 2019
wget -O urserver.deb http://www.unifiedremote.com/d/linux-x64-deb
sudo dpkg -i urserver.deb
Start
./opt/urserver/urserver-start
Uninstall
$ sudo dpkg -r urserver
FTP Problems:
If files are getting unloaded, but the wrong size, and with errors, you are uploading in ASCII not Binary!!!
Show Image Size Width Height:
May2023:
http://ppa.launchpad.net/atareao/nautilus-extensions/ubuntu/pool/main/n/nautilus-columns/
Install: nautilus-columns_0.3.8-0extras20.04.7_all.deb
http://ppa.launchpad.net/atareao/nautilus-extensions/ubuntu/pool/main/n/nautilus-columns/nautilus-columns_0.3.8-0extras20.04.7_all.deb
gsettings set org.gnome.nautilus.list-view default-visible-columns "['name', 'size', 'date_modified','image_width','type']"
Old:
sudo add-apt-repository ppa:atareao/nautilus-extensions
sudo apt update
sudo apt install nautilus-columns
nautilus -q
Solve the "browser does not currently support any of the video formats" message?:
sudo apt install ffmpeg
New Build Install:
sudo apt install filezilla
software-properties-gtk
In Ubuntu Software->Source Code (Check it)
Edit > Settings > Interface
On startup of FileZilla
"Restore Tabs and Reconnect"
NKDE Connect Wont Install:
sudo sed -i '/cdrom/d' /etc/apt/sources.list
Firefox Add-ons Extensions
AdBlocker for YouTube
Files / Gnome / Desktop Froze
Terminal: xkill
Click on it
Run with : sudo nautilus
Prevent Freezing !!Attempt!!
sudo gedit /etc/profile
#added Jan2021
setxkbmap -option terminate:ctrl_alt_bksp
Screenshot Location:
2020 Solution:
https://extensions.gnome.org/extension/1179/screenshot-locations/
sudo apt-get install chrome-gnome-shell
If Not Installed: sudo apt-get install dconf-editor
dconf-editor
Go to: org> gnome> gnome-screenshot
Set Auto-save-directory to: file:///home/adam/Downloads/
Default-File-Type: JPG
You MIGHT also have to disable the Settings->Keyboard Shortcuts
Add a new one ("+" Icon is at the bottom)
And create one for "gnome-screenshot"
Not Used
Normalize Volume:
Run "Software Updater"
Update:
sudo apt install ladspa-sdk
analyseplugin /usr/lib/ladspa/dyson_compress_1403.so
Link
LXDE Screen Saver Disable:
xset s noblank
xset s off
xset -dpms
Get Files Off your PHone "Android File Transfer" Flip to Download Tab. Put Phone in "Use USB For" "File Transfer"