Cronjob, tar, autostart, sudo, grep
cronjob
- execute all listed cronjobs:
crontab -l | grep -v '^#' | cut -f 6- -d ' ' | while read CMD; do eval $CMD; done - send mail address https://de.godaddy.com/blog/behalten-sie-ihre-cron-jobs-unter-kontrolle/
tar
useage: tar [OPTION...] [FILE]...
create archive:
- unzipped
-
tar -cf archiv.tar datei_1.txt *.pdfCreate archiv.tar with 1 file and all pdfs -
tar -cf archiv.tar path/Create archiv.tar with all subdir -
tar -rf archiv.tar datei_1.txtAdd 1 specific file to archiv (unconpressed)
-
- zipped
-
tar -czf archiv.tar.gz fileCreate archiv.tar.gz
-
extract archive:
-
tar -xf archiv.tarExtract files -
tar -xzf archiv.tar.gz -C /Extract gzip archives -
tar -xzf archiv.tar.gz -C /pathExtract gzip archives to /path
tar -tvf archiv.tar Show which files are in archiv.tar
autostart
- create new file
- user only
sudo nano ~/.config/autostart/<some_name>.desktop - global
sudo nano /etc/xdg/autostart/<some_name>.desktop
- user only
- insert content like:
[Desktop Entry] Type=Application Name=Musterprogramm Exec=Auszuführendes Kommando
sudo
add user to sudo
su -
usermod -aG sudo <username>
no password sudo
- edit sudoers file with
sudo visudo - add line at end of file (important for not be overriten):
username ALL=(ALL) NOPASSWD:ALL
grep
-
arguments:
-
-i, --ignore-caseIgnore case distinctions in both the PATTERN and the input files.
-
-
use cases: