Skip to content

Instantly share code, notes, and snippets.

@kurorido
Last active October 20, 2015 15:54
Show Gist options
  • Save kurorido/d1be369b6b882eeef065 to your computer and use it in GitHub Desktop.
Save kurorido/d1be369b6b882eeef065 to your computer and use it in GitHub Desktop.
adduser mynewuser
sudo visudo
root ALL=(ALL:ALL) ALL
newuser ALL=(ALL:ALL) ALL
uname -a for all info regarding kernel version,
uname -r for exact kernel version
lsb_release -afor all information related to ubuntu version,
lsb_release -r for exact version
sudo fdisk -l for partition info with all details.
rsync -arv --exclude=.ccache --exclude=build /home/ben /media/ben/thumbdrive/
http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/
## find out mount/partition a directory or file is on?
df -P file/goes/here | tail -1 | cut -d' ' -f 1
# delete line 135 in file, and save origin file into file.bak
sed -i.bak -e '135d' file
# Recursive find string from files
grep -R -i -n '<string>' <directory>
# nohup
nohup your_command &>myout.txt &
tail –f nohup.txt
# kill process listening on port 23456
sudo kill -9 `sudo lsof -t -i:23456`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment