Category: Bash / Terminal / Scripts


from recording a webradio i had a load of those files, which were kind of tricky to delete. The trick is to use find instead of rm. find -name "*————— – —————*"; #dry run ./————— – ————— (20).aac ./————— – […]


you can either use wget to download the webpage or use Firefox Ctrl+S (Save As) wget; # download webpage # become root sudo bash; # or su; apt-get update; apt-get install lynx; lynx -dump "website.html" | awk ‚/http/{print $2}’| […]


sudo bash; # become root #create directories mkdir -p /backup/mysql # backup every database manually separately mysqldump -u root DATABASE_NAME > /backup/DATABASE_NAME.sql; # backup every database separately automatically (easier to restore) for db in $(mysql -u root -e ’show databases‘ […]


apt-cache showpkg evolution-common Package: evolution-common Versions: 3.12.9~git20141130.241663-1 (/var/lib/apt/lists/ftp.uni-erlangen.de_debian_dists_jessie_main_binary-i386_Packages) (/var/lib/dpkg/status) Description Language: File: /var/lib/apt/lists/ftp.uni-erlangen.de_debian_dists_jessie_main_binary-i386_Packages MD5: 63a9c80d6efb5e50b74aae7ebcc8bf5c Description Language: en File: /var/lib/apt/lists/ftp.uni-erlangen.de_debian_dists_jessie_main_i18n_Translation-en MD5: 63a9c80d6efb5e50b74aae7ebcc8bf5c Reverse Depends: gnome-panel,evolution-common 3.4.3 evolution,evolution-common 2.91 evolution,evolution-common 3.12.9~git20141130.241663-1 almanah,evolution-common 3.6.0 Dependencies: 3.12.9~git20141130.241663-1 – dconf-gsettings-backend (16 (null)) gsettings-backend (0 […]


UNTESTED! #!/bin/bash DBUSR=UserNameThatIsAllowedToUseMYSQLDUMP DBNAME=NameOfDatabaseOfProject echo "========= backup database – you will have to provide the password manually" mysqldump -u "$DBUSR" -p "$DBNAME" > /var/www/vhosts/"$PROJECT"/httpdocs/"$DBNAME".sql gzip /var/www/vhosts/"$PROJECT"/httpdocs/"$DBNAME".sql; echo "============== backing up "$PROJECT tar fcvvvz /var/www/vhosts/"$PROJECT"/backups/"$PROJECT"_files_backup_$(date +%Y-%m-%d-%M).tar.gz /var/www/vhosts/"$PROJECT"/httpdocs # remove […]


this kind of content-search might take a while, because it searches EVERY file. # qnap (busybox) tested/approved su; # become root cd /; # go to root directory # start search in all files find . -type f | xargs […]