Friday, March 20, 2009

Bash Commands

Ctrl + xx Move between EOL and current cursor position

Ctrl-a Move to the start of the line.
Ctrl-e Move to the end of the line.

Ctrl-b Move back one character.
Ctrl-f Move forward one character.

Alt-b Move back one word.
Alt-f Move forward one word.

Alt-] x Where x is any character, moves the cursor forward to the next occurance of x.
Alt-Ctrl-] x Where x is any character, moves the cursor backwards to the previous occurance of x.

Ctrl-u Erase the current line.
Ctrl-k Delete from the cursor to the end of the line.
Ctrl-w Delete from the cursor to the start of the word.
Esc-Del Delete previous word (may not work, instead try Esc followed by Backspace)
Alt + d Delete word

Ctrl-y Pastes text from the clipboard.
Ctrl-l Clear the screen leaving the current line at the top of the screen.

Ctrl-x Ctrl-u Undo the last changes. Ctrl-_ does the same
Alt-r Undo all changes to the line.
Ctrl-d Delete from under the cursor
Ctrl-r Search the history backwards
Ctrl-R Search the history backwards with multi occurrence
Ctrl-xx Move between EOL and current cursor position
Ctrl-x @ Show possible hostname completions

Alt-< Move to the first line in the history
Alt-> Move to the last line in the history
Alt-? Show current completion list
Alt-* Insert all possible completions
Alt-/ Attempt to complete filename
Alt-. Yank last argument to previous command
Alt-back-space Delete backward from cursor

2T = TAB twice
/2T Entire directory structure including Hidden one
*2T Only Sub Dirs inside without Hidden one

Alt-n Search the history forwards non-incremental
Alt-p Search the history backwards non-incremental

Alt-t Move words around
Alt-u Make word uppercase
Alt-l Make word lowercase
Alt-c Capitalize the word

Monday, March 16, 2009

Rpm commands

rpm -Uvh packages(s).rpm install/upgrade package file(s)
rpm -e package remove package
rpm -qa '*spell*' show all packages whose names contain the word spell
rpm -q package show version of package installed
rpm -q -i package show all package metadata
rpm -q -i -p package.rpm show all package file's metadata
rpm -q -f /path/file what package does file belong
rpm -q -l package list where files were installed
rpm -q -l -p package.rpm list where files would be installed
rpm2cpio package.rpm | cpio -id extract package files to current directory
rpm -q --requires package list files/packages that package needs
rpm -q --whatrequires package list packages that need package (see also whatrequires)

Monday, March 2, 2009

Format USB Disk On Linux

Get the /dev mount point of the USB disk,
list file system using mkfs command, and then write desired filesystem command

let us select mkfs.vfat

then apply command
#sudo mkfs.vfat /dev/sda1
give label to USB disk using
#sudo e2label /dev/sda1 jaimin-usb-disk