-
Notifications
You must be signed in to change notification settings - Fork 2
Linux Basics
Edward Brown edited this page Sep 26, 2016
·
3 revisions
###VIM
vim is hard to get use to, here is a good web site for all commands http://www.tuxfiles.org/linuxhelp/vimcheat.html Just like .bashrc there is a .vimrc
user$ vim .vimrc
add these to the file
[i] # Press the I button to enter insert mode
set ai # auto indent
set ts=4 # set tab to 4 spaces
set et # save a tab as 4 spaces
set show mode # show what mode you are in at the bottom (command, insert...)
set number # show line numbers
[Esc] # Press the Esc Key to enter command mode
[ZZ] # Press SHIFT ZZ to save and exit
Janus is a distribution of plug-ins and mappings for Vim, Gvim and MacVim. https://github.com/carlhuda/janus
curl -Lo- https://bit.ly/janus-bootstrap | bash
####Making shortcuts with alias
user$ vim .bash_aliases
Basic commands to add shortcuts for
alias ls='ls --color=always'
alias ll='ls -l'
alias la='ls -A'
alias la='ls -lA
alias c='clear'
alias vi='vim'
alias machinename='ssh [email protected]'
Add this file to your .bashrc
user$ vim .bash_aliases
Add this to the end of the file
source .bash_aliases
Save file, source .bashrc
user$ source .bashrc
-
Definitions
- username - your username
- computername - the hostname of the computer
- shortcut-name - an abbreviated version of the host name
- scp - secure copy
- dir - directory
- file - any .txt .cpp ....
####Long Way
scp file [email protected]:dir/file
scp [email protected]:dir/file file
####Short Way
user$ vim ~/.ssh/config
Add the following to the file
Host shortcut-name
Hostname computername.llnl.gov
User username
Once you save and exit, source the file
user$ source ~/.ssh/config
scp file shortcut-name:dir/file
scp shortcut-name:dir/file file