Quickly define the file lines limit and cut the first lines

Use this command if you want to keep only a certain number of the most recent lines in the file without using an additional file.

Replace:
* yourFileName – your filename
* 200 – the number of lines you want to keep

 

How to create bootable Linux USB flash drive

  1. Insert your flash drive
  2. Format it by GParted and check your flash drive path i.e. /dev/sdb
  3. Umount your flash drive
  4. Run terminal and push iso to your flash drive by command:
  5. Wait for finish
  6. Reboot

The most resource hungry processes on Linux

The command with which we will see a list of processes that consume the most RAM (resources).

Instead of 10 you can specify any number of processes displayed.

To kill any process write:

Continue reading The most resource hungry processes on Linux

Automatically backup SeaFile data and delete old backups

Automatically backup SeaFile data
and delete old backups

Daily backups will be stored in the /root/backups/ and copies older than 7 days will be automatically deleted.

Make file /root/backup.sh

Change /var/www/seafile-server/install on yours Seafile install path.
Change /var/www/seafile-server/cloud_storage on yours Seafile data path.

In the terminal crontab -e add entry:

read more about – find
read more about – crontab
read more about – tar
read more about – rm
read more about – find