Posts

Format disk partitions

 Introduction Partitions can be easily managed under Linux. You can delete and create disk partitions as needed and format in the desired filesystem so that can be later mounted and be ready for use with the help of two powerful utilities; fdisk and lsblk .  Checking disk partitions fdisk can used to list partitions on attached devices. Use it without arguments to list partitions for all attached devices or you can explicitly specify the desired device: sudo fdisk -l /dev/sda  > /dev/sda1 > /dev/sda2 > /dev/sda3 Deleting and re-create disk partitions Supposing that /dev/sda has 3 partition we can delete them using fdisk : sudo fdisk  /dev/sda fdisk is a dialog driven utility, so it won't return to your usual prompt. Commands are buffered and will take effect only when changes are to be written to the disk. > Command (m for help): d > Command (m for help): d > Command (m for help): d   Verify partitions deleted: > Command (m for help): p Cre...

VI Cheat Sheet

VI Cheat Sheet opening multiple files $ vim file1 file2 :e filename switching between files :n || :bn - switch to the next file :N || :bp - switch to the previous file :bf - switch to the first file :bl - switch to the last file :b <number> - switch to a specific file number :b <filename> - switch to a specific file filename :e# || Ctrl+^ - witch back and forth between two files :ls - list all open files (In the ls: output, the % refers to the current file, while the # refers to the alternate file) :wall - save (write) all open files :bw - quit the current file :qall - quit all open files :qall! - forcefully quit all files, discsarding changes opening and switching between multiple windows splitting windows horizontally $ vim -o file1 file2 :split <filename> || Ctrl+w,s - split windows horizontally in Vim; if no file filename is given the current file will be displayed in both splits splitting windows vertically $ vim -O fil...