Posts Tagged - linux

Vim advanced commands

Useful commands to master vim

Tips

All delete commands which are run with d, may use instead c. This will do the same delete operation, but will open directly on insert mode afterwards.

Help

Type :help change.txt

Redirect input into a Vim buffer

cat input | vim - This, ran from bash, outputs the result of a command or a file into a vim buffer, where we can do whatever with it, without modifying the original source.

Read More

Advanced bash and zsh

General, useful things

curl cheat.sh/command_to_search shows a cheatsheet with options for this command

Snap

Offline .snap file install

To install a .snap file you downloaded you need to

sudo snap ack downloaded_file.snap
sudo snap install downloaded_file.snap

# if the ack doesn't work, you can always install it with
sudo snap install --dangerous downloaded_file.snap

Processing files and data

  • find . -iname "*file_to_search*" search something at current directory
  • locate file_to_search search through whole computer
  • rg general searching through data files. Better than grep -r
  • diff -y --suppress-common-lines file1 file2 | grep '^' | wc -l count number of changes between 2 files

Read More

Prepare a fresh linux installation

Steps needed to prepare a Linux system when it was completely wiped out or is new. (most) commands are ready to copy and paste.

Prepare System

Automatic installations

sudo apt install snapd htop &&
sudo snap install postman rambox vlc postman spotify tor google-cloud-sdk &&
sudo snap gitkraken install intellij-idea-community pycharm-community --classic

Copy aliases

Copy the following file into ~ (add link to my aliases file)
Set it so it auomatically loads on startup. Add the following line at ~/.bashrc or ~/.zshrc

source ~/zsh_aliases

Folders to create

mkdir ~/Documentos/personal ~/Documentos/projects ~/programs ~/tmp

Read More