Category: bsd
-
Cron headers unix / linux
Compact: #.—————- min (0-59) #| .————- hr (0-23) #| | .———- dom (1-31) #| | | .——- mon (1-12) #| | | | .—- dow (0-7|mon-sun0) #| | | | | Wide:
-
Backup and restore permissions linux (accidental chmod -R)
cd /etc/ chmod -R 664 . *SHIT!* If you find you did an accidental chmod -R, you may be able to restore it. Make sure SSH login keeps working (chmod -R 0600 /etc/ssh ) Install a similar machine On that machine, issue this command: find /etc/ -exec stat –format “[ ! -L \”{}\” ] &&…
-
My tip: a temporary directory (for temporary files)
My tip: make a temporary directory for all kinds of random stuff. Downloads, quick notes et cetera. I use it a lot. By using a crontab like this, the old files (+5 days) are automatically deleted: $ find /home/karlo/temp/ -type f -mtime +5 -delete && find /home/karlo/temp/ -empty -delete
-
Use $top over SSH
If you want to use `top` over SSH, use the -t option: $ ssh -t servername top This also works if you want to use `tail -f` over ssh: $ ssh -t servername “tail -f”