Skip to content

Latest commit

 

History

History
executable file
·
101 lines (47 loc) · 1.71 KB

README.md

File metadata and controls

executable file
·
101 lines (47 loc) · 1.71 KB

Scripting

Basic commands

cd: change directory

echo: write

touch: change modification date. create new file.

ls: list a directory

cp: copy files

mv: move files, rename files

rm: remove files

mkdir: create directories

rmdir: delete empty directories

date: show current date

who: show users in the system

whoami: show user name

sort: sort lines in a file

wc: count characters, words and files

fgrep, grep, egrep: search strings in files

pwd: current directory

cmp, diff: compare files

cat; write in the standard output the content of one or two files

less: allow to read a file in the terminal using scroll

file: info about the content of a file

head: write the first lines of the file in the standard output

tail: write their last lines of the file in the standard output

top: show the processes in the system

exit: shell finish its execution

First steps in VIM

VIM is this text editor based on VI editor, more easy to use, here there are some useful commands not to decay in the attempt to use. VIM is on default in your system(supposing you are using a unix system).

to create a file + open VIM editor: vim file.extension

  • Select two modes:

i: insertion mode

[ESC]: command mode

  • In command mode:

:q: exit editor

:w: save changes

:wq: save changes + exit editor

:x: save changes + exit editor

:w: save changes

:number: move to that number of line in the file

:i: insert before the cursor

:a: insert after the cursor

:o: insert a new line

:dd: cut a line

:p: paste the line previously cut

:h, j, k, l: move the cursor to left, down, up, right

visit linux manual: man [command] its a good source of wisdom