begin29
5/2/2016 - 3:09 PM

Linux commands and articles

Linux commands and articles

#see all usb devices
sudo fdisk -l
sudo parted -l
lsblk

# formt to fat32 flash drive sdb
# -I override all partitions on usb drive
sudo mkfs.vfat -I /dev/sdb
mkdosfs -F 32 -I /dev/sdc1

#mount usb drive to /media/usb/ 
sudo mount /dev/sdb /media/usb

#mount with permition
sudo mount /dev/sdb /mnt/
# restart network manager. when can't find wifi network
sudo service network-manager restart
# set input order for mouse with id 12
# check input ids: 
# $ xinput list
xinput set-button-map 12 3 2 1
# disable display
xrandr --output LVDS1 --off

# enable
xrandr --output LVDS1 --on

# set primary
xrandr --output HDMI3 --primary

# choose output side
xrandr --output LVDS1 -o left
#create link
ln -s /path/to/file /path/to/symlink

#see all available memory
df -h

#returns the number of lines, words, and bytes in a file. Can use -l, -w, -c to get just one of these.
wc

# change user password
sudo passwd USERNAME

#see mysql version
dpkg -l 'mysql-server*'

# see ubuntu version
lsb_release -a

# make custom script run on boot system
https://debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian

# Schedule Tasks on Linux Using Crontab
http://kvz.io/blog/2007/07/29/schedule-tasks-on-linux-using-crontab/

#how to execute script on click 
http://askubuntu.com/questions/138908/how-to-execute-a-script-just-by-double-clicking-like-exe-files-in-windows

# suspend after 5 sec via sudo user with password 
sleep 5 && echo 'user password' | sudo -S pm-suspend

# increase brightness in a bit
xrandr --output LVDS1 --brightness 1.05

#make bootable iso disk
sudo dd if=/home/path/to/iso of=/dev/sdb* bs=1M