Linux - Ubuntu - Random commands
Nov 10, 2019 | Reading Time: 2 min
Random collection of commands for Ubuntu Linux.
Top
Description | Command |
---|---|
display top with threads | top -H |
top with output sorted by memory | top -o %MEM |
run top in batch mode 10 times with 5 seconds delay in command mode with output sorted by memory | top -b -n 10 -d 5 -c -o %MEM |
run top in batch mode 10 times with 5 seconds delay in command mode with output sorted by memory and only print 15 lines at a time | `top -b -n 10 -d 5 -c -o %MEM |
Jekyll
Reference - Using with bundler
Description | Command |
---|---|
serve jekyll locally | bundle exec jekyll serve |
Virtualbox
Description | Command |
---|---|
create a vmdk using raw device | VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/sdb |
Rsync
Description | Command |
---|---|
rsync to a remote server using ssh protocol and show progress | rsync -avzhe ssh --progress ./localfolder user@<remote server name/ip>:/remote/folder/location |
Option to transfer files upto a certain size | --max-size=<n>m |
Disk paritions
Create a ntfs partition from an empty disk
1sudo fdisk /dev/sdb
2# fdisk is interactive
3# press m for help
4# Press p to list any available partitions
5# create a new partition by using n
6# after altering partitions press w to write
7# make a ntfs file system with "quick format" i.e dont write zeroes and dont check for bad sectors
8# remove f for full format
9mkfs.ntfs -f /dev/sdb1
10blkid
11# Note the UUID of the partition E.g: /dev/sdb1 UUID="asdfg1246"
12# Adding a entry in /etc/fstab
13 UUID=asdfg1246 /disk1 ntfs-3g permissions,locale=en_US.utf8 0 2