for (( i=1 ; i<=1000 ; i++ )); do cp /in/courrier/tessi_videocodage/import/C_0.pdf /in/courrier/tessi_videocodage/import/C_0$i.pdf; done
tar -zcvf votre_archive.tar.gz votre_dossier/
tar -zxvf votre_archive.tar.gz -C votre_dossier_cible/
tar -zxvf indexes_20180429T203402.tar.gz "indexes/45"
7z a -y -mx -t7z zz-Archives.7z zz-Archives/
for i in $(ls); do cp sourcefile $i; done
autre exemple : for i in $(ls); do cp post-commit $i"/hooks"; done
for (( i=1 ; i<=10 ; i++ )); do php test_ws_store_resource.php; done trouver les fichiers récements modifiés
find /mydir -type f -mtime -1 -print
find . -type f ( ! -path "./cache/" ! -path "./views/" ! -path "./styles/" ! -path "./includes/" ! -path "./images/*" ) -atime -150 -print
netstat -ntlp | grep LISTEN lsof -i:4444 -> donne les processus écoutant sur ce port
find . -name ".svn" -type d -exec rm -Rf {} \; Trouver des fichiers plus vieux de 10 jours find /srv/backups/gandibackups_from_scp -maxdepth 1 -type f -atime +10
cd / grep -r 'info@maarch.org' * > result_search
rm -Rf $(ls | grep -v 'wordpress|phpmyadmin')
ls -1 /home/maarch/source | xargs -i cp -R /home/maarch/source/{} /home/maarch/destination
ls -Al /home/maarch/source | wc -l
find /opt/maarch/imports/autoimport/CGR_REPRISE_COMPTA -name '*.xml' | wc
# recherche récursive dans tous les fichiers du dossier actuel et ses sous-dossiers
grep -Hirn 'texte cherché'
# recherche uniquement dans les XML
find /var/www/html/ -name '*.xml' -exec grep -Hin 'texte cherché' {} \;
Pour info les options de grep
:
-H
: affiche le nom du fichier-i
: recherche insensible à la casse-r
: recherche récursive dans tous les fichiers à partir du dossier courant-o
: affiche uniquement la partie de la ligne correspondant à la recherche et non la ligne entière, utile en cas de très longues lignes-n
: affiche le numéro de la ligne correspondantetree -finpug
ls -lh | awk '{print $5, $9}'
sed -i -e "s/PASSWORD_MAIL_DSAF/lemotdepasse!test/g" *.XML
find /var/www/html -type f -exec sed -i 's/5432/5434/g' {} \;
sudo find www/ -type f ( ! -iname ".cache" ! -iname ".pyc" ! -iname ".png" ! -path "www/maarch.com/" ! -path "www/demo.maarch.org/entreprise_" ! -path "www/demo.maarch.org/cilbox/" ) -atime -1 > result
sudo find www/ -type f -atime -5 > result
ps -aef | grep ^www-data | awk '{ print "kill -9 " $2 }' | sh
curl wttr.in/nanterre
openssl pkcs12 -in ~/OS201403208071.pfx -out mypenfile.pem
openssl pkcs12 -export -in mypenfile.pem -out mykeystore.p12 -name "MyCert"
jarsigner -storepass MaarchCertif2014 -tsa http://timestamp.globalsign.com/scripts/timestamp.dll-storetype pkcs12 -keystore mykeystore.p12 NetBeansProjects/maarchCM/dist/maarchCM.jar "MyCert"
cd /home/lgi/NetBeansProjects jarsigner -storepass MaarchCertif2014 -keystore ../mykeystore.p12 -tsa http://timestamp.globalsign.com/scripts/timestamp.dll ../NetBeansProjects/maarchCM/dist/maarchCM.jar "mydomain"
sudo dpkg-query -l | grep xdebug
zip -0 -X ../my-document.odt zip odt zip -r ../my-document.odt * -x mimetype
find /var/www/html/oem/ -not -path '.svn/' -mmin -120
find / -type d -name 'httpdocs'
sudo ifdown -a
sudo ifup -a
sudo dhclient
sudo start network-manager
sudo /etc/init.d/network-manager restart
Now you have two completely separate versions of PHP installed on your system, so let's have a look at where all the pieces went!
The config files are all in /etc/php/5.6 and /etc/php/7.0 respectively - inside here is where you can configure which extensions are loaded, set the ini settings, and everything else for each version in isolation.
I'm an apache user, and as I mentioned both modules are available. So to switch from one to the other I need to do:
sudo a2dismod php5.6 sudo a2enmod php7.1 sudo service apache2 restart sudo mv /usr/bin/php /usr/bin/php_BAK sudo rm /usr/bin/php sudo ln -s /usr/bin/php7.1 /usr/bin/php
sudo a2dismod php5.6 sudo a2enmod php7.0 sudo service apache2 restart
sudo a2dismod php7.1 sudo a2enmod php5.6 sudo service apache2 restart sudo mv /usr/bin/php /usr/bin/php_BAK sudo rm /usr/bin/php sudo ln -s /usr/bin/php5.6 /usr/bin/php
$ git fetch --tags
$ latestTag=$(git describe --tags git rev-list --tags --max-count=1
)
$ git checkout $latestTag
git describe --abbrev=0 --tags
Increase size of request in apache for REST webservices
LimitRequestLine 10000000000000000
docker images
docker build . -t maarchcourrier
docker exec -it maarchcourrier-develop /bin/bash
UPDATE users set password = '$2y$10$C.QSslBKD3yNMfRPuZfcaubFwPKiCkqqOUyAdOr5FSGKPaePwuEjG', change_password = 'N' WHERE user_id != 'superadmin'; UPDATE users set password = '$2y$10$Vq244c5s2zmldjblmMXEN./Q2qZrqtGVgrbz/l1WfsUJbLco4E.e.' where user_id = 'superadmin';
UPDATE users set password = '65d1d802c2c5e7e9035c5cef3cfc0902b6d0b591bfa85977055290736bbfcdd7e19cb7cfc9f980d0c815bbf7fe329a4efd8da880515ba520b22c0aa3a96514cc', change_password = 'Y' WHERE user_id != 'superadmin'; UPDATE users set password = '964a5502faec7a27f63ab5f7bddbe1bd8a685616a90ffcba633b5ad404569bd8fed4693cc00474a4881f636f3831a3e5a36bda049c568a89cfe54b1285b0c13e' where user_id = 'superadmin';
dpkg-reconfigure locales
for b in "git branch -r | grep -v -- '->'"; do git branch --track ${b##origin/} $b; done for b in "git branch -r | grep -v -- '->'"; do echo $b; done
branches=() eval "$(git for-each-ref --shell --format='branches+=(%(refname))' refs/heads/)" for branch in "${branches[@]}"; do echo $branch done
gestion de wikijs lancement node wiki start arrêt node wiki stop
gitbook serve gitbook build
git pull npm i npm run build-prod
git reset --hard HEAD git rebase git fetch
netstat -anp | grep --regexp="5432" | grep apache2 | awk -F" " '{print $7}' | awk -F"/" '{print $1}'
echo kill $(sudo netstat -anp | grep --regexp="5432" | grep apache2 | awk -F" " '{print $7}' | awk -F"/" '{print $1}')
su - mkdir /opt/postgtresql chown -R postgres. /opt/postgtresql su postgres /usr/lib/postgresql/11/bin/initdb -D /opt/postgtresql
cd /opt/postgresql
convert -thumbnail 800x1200 -background white -alpha remove install/samples/res_attachments/invitation.pdf install/samples/tnl/invitation.png
find /directory/of/interest/ -type f -iname "*.sh" -exec chmod +x {} \;
du -ah /home/maarch | sort -n -r | head -n 5
sudo service postgresql restart se connecter à la base par défaut "postgres" create database nouvelle_base with template ma_base_a_dupliquer;
find . -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "
sed '/RES_ID : /d' travailv1.log > travailv2.log