Excalibur's Sheath

The Ultimate Linux Cheat Sheet

Apr 6, 2014 • linux,bash,unix

A while back I wrote a post of BASH or SSH Commands. In this post I add several other useful Linux commands.

BASH Commands

ls -alh list directory history lists a history of commands run cat Display file on screen grep keyword search less read a file and format for pages host displays server name clear clears the terminal screen exit exits terminal log in kill kills processes rm remove file cp copy a file mv move a file vi advanced text editor nano text editor strings Interprets Binary files and shows what can be printed on the screen cd change working directory pwd print working directory tail displays the last 10 lines of the file unless -n is used to tell it how many lines to go up -c is how many bytes you want. -f to follow the log. touch creates an empty text file and updates the modified date outputs the current date of the system which gives full binary path to commands

Vi and Vim Commands

In the Linux community there seems to be no conflict greater than the Emacs vs vi/vim editor, with others, like Pico/Nano/Joe with vocal minorities. I started with Pico as my first editor. I have since used many systems, and I find vi or vim most likely installed by default.

Vim has many commands. Whole books cover it. Here are some basic commands to get you started. dd - Delete Line. You can also type a number and dd to delete multiple lines. wq - Save and quit. q! - Quit without saving. set nu - Show line numbers. i - Insert text.

BASH Oneliners 100 vim commands every programmer should know