tiistai 20. syyskuuta 2016

Learning Linux at University

I had to learn more about Linux at the university and so far I have learned couple of handy things.

  1. You can configure nano settings with .nanorc file
  2. Add alias commands to  .bash_aliases
  3. Make some ALIAS. ls --color=auto for ls
  4. Alias O for ls -latr listing all files in order, newest at bottom.
  5. SCP files with scp filename username@host:/Where in remote
  6. ssh-keygen -t RSA -b 4096 Generates ssh keys
  7. ssh-add starts ssh-agent until computer is shutdown. 
  8. Adding id_rsa.pub file content to authorized_keys in server allows ssh without typing password
  9. in ~/.ssh create config file without file extension and set ssh configs. Like:
    Host NAME
        HostName nikiahlskog.com
        User USERNAME
        Identityfile ~/.ssh/id_rsa.pub
    Then you can just use ssh name for example.
  10. RSYNC. It copies only changed files. Very handy! use it like: rsync --progress filename user@server:dir handle -a copies folder content
  11. Crontab. Using crontab -e is dangerous. Because crontab -r empties whole table and there is no undo. Create folder for cronjobs and create file for example cron.tab add your job to the file for example: 0,30 * * * * echo `date +%Y-%m-%H\ %k:%M:%S` cron job done then add this file to crontab with crontab ~/cronjobs/cron.tab see all your cron jobs with crontab -l to remove cronjobs juse handle -e

Ei kommentteja:

Lähetä kommentti