Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VIM: x to delete left. X to delete right
- Terminal echo:
- \r => Erase everything in the same line before this statement
- \n => New Line (Enter)
- \t => Indent. Make space 5x
- \b => Backspace. Omit/Erase 1 character before this statement
- \c => Print the next output in the same line
- \033[1m => Bold the text. Everything.
- \033[0m => Normal the text.
- Terminal tput:
- clear => Clear Terminal
- lines => Display number of rows on screen (terminal size)
- cols => Display number of columns (terminal size)
- cup 15 20 => Where on the terminal we want to output a string. It can override existing output
- bold => Print in bold. Same with \033[1m
- _____________________________
- echo $?
- 0 => Success
- 1 => Failed
- _____________________________
- echo "Enter source and target file names."
- read source target
- mv $source $target
- Terminal if-then:
- if 0
- then
- echo "Your file success"
- elif => else if
- then
- else
- fi (closure for if-then-else statement)
- Terminal Count:
- Check number input between:
- [ $<variable> -lt 10 ]
- lt => less than
- gt => greater than
- le => less than and equal to
- ge => more than and equal to
- ne => not equal to
- eq => equal to
- must have space after [ and before ]
- Terminal run check on files:
- if [ -f $<variable file name> ] => 0 if file. 1 if folder
- -f => file
- -d => directory (folder)
- -c => character special file
- -b => blok/image/video file
- -r => Check read permission
- -w => Write permission
- -x => Execute permission
- -s => Size of file
- -z => Check null. If null, return 0
- -n => Check if more than 0. If more than 0, return 0
- -a => AND Logical Operator
- -o => OR Logical Operator
Add Comment
Please, Sign In to add comment