sed delete line with matching string

To Delete all lines containing word welcome within test.txt use -i option with sed:

sed -i '/welcome/d' test.txt
Advertisements

Linux–Delete files older than days

$ find /path_to_files/* -mtime +days -exec rm {} \;

Example: find /home/user/Desktop/folder/* -mtime +60 -exec rm {} \;

Above command deletes files in location /home/user/Desktop/folder older than 60 days