CLI tricks and basic knowledge of UNIX

  • check diff of two files
vimdiff file1.txt file2.txt
  • open pdf files using CLI
xdg-open foo.pdf
  • Actually an VM ubuntu trick... to hide the window: super + h; not for my machine

  • to read man read(2)

$ man 2 read
  • difference between exit(0) and return 0
return exits from the function while exit exits from the program.
In main function executing return 0; statement or calling exit(0) function will call the registered 
atexit handlers and will cause program termination.
//The atexit handlers get called when returning from main, too
  • kill -l
    • this command will list all the SIGNALS

Learned System calls

  • lseek(2)
  • read(2)
  • write(2)
  • signal(2)
  • alarm(2)
  • kill(2)
    • kill(pid, signal) that will kill a process pid when receive 'signal'

Commands that to do with process:

  • ps
    • show all the running process
  • kill

    • commands to kill one or more process
% kill -9 1274 1297

ADD to PATH (studio.sh for example)

//first do the following to add path
export PATH="$PATH:/usr/local/Android/android-studio/bin"

//next edit .zshrc and add alias
alias astudio=/usr/local/android-studio/bin/studio.sh

//last source the zsh
source .zshrc

//ALL DONE LOL!!

results matching ""

    No results matching ""