introduction à l'utilisation du linux "ubuntu", sous windows 10
sous-système Windows pour Linux
Windows Subsystem for Linux (WSL)
reboot
puis choix de la distribution Linux (Ubuntu, Suse ...)
sous-système Windows pour Linux
Windows Subsystem for Linux (WSL)
reboot
puis choix de la distribution Linux (Ubuntu, Suse ...)
user: be4
shell: bash
Copy Ctrl+C
Paste Ctrl+V
vs
Copy Ctrl+Shift+C
Paste Ctrl+Shift+V
= avec espace !!
shell: bash
Copy Ctrl+C
Paste Ctrl+V
vs
Copy Ctrl+Shift+C
Paste Ctrl+Shift+V
= avec espace !!
# ll /etc/*eleaseubuntu.com/tutorials/tutorial-ubuntu-on-windows-rw-r--r-- 1 root root 105 Jan 30 2020 /etc/lsb-release lrwxrwxrwx 1 root root 21 Jan 30 13:28 /etc/os-release -> ../usr/lib/os-release# cat /etc/*eleaseDISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS" NAME="Ubuntu" VERSION="18.04.4 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.4 LTS" VERSION_ID="18.04" ...

reset-the-password in ubuntu linux bash in windows
passer par une fenêtre powershell en tant d'admin
PS C:\WINDOWS\system32> ubuntu config --default-user root
ubuntu.... passwd / ou passwd user = mettre un new passwd (1234)
puis remettre le nom par def.
PS C:\WINDOWS\system32> ubuntu config --default-user be4
src: src qastack.fr/ reset-the-password-in-ubuntu-linux-bash-in-windows
testé 02/2022
pour: installer lynx
sudo apt install lynx
... no
sudo apt update
212 pkg can be upgrades
apt list --upgradable
apt install lynx
lynx http://xxxxx.fr = ok now
passer par une fenêtre powershell en tant d'admin
PS C:\WINDOWS\system32> ubuntu config --default-user root
ubuntu.... passwd / ou passwd user = mettre un new passwd (1234)
puis remettre le nom par def.
PS C:\WINDOWS\system32> ubuntu config --default-user be4
src: src qastack.fr/ reset-the-password-in-ubuntu-linux-bash-in-windows

testé 02/2022
pour: installer lynx
sudo apt install lynx
... no
sudo apt update
212 pkg can be upgrades
apt list --upgradable
apt install lynx
lynx http://xxxxx.fr = ok now
différent d'un Unix (PATH,....) je finis avec un script be4@indy3:~$ cron cron: can't open or create /var/run/crond.pid: Permission denied be4@indy3:~$ sudo apt install cron [sudo] password for be4: Reading package lists... Done Building dependency tree Reading state information... Done cron is already the newest version (3.0pl1-128.1ubuntu1). cron set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 212 not upgraded. be4@indy3:~$ sudo service cron status * cron is not running be4@indy3:~$ sudo service cron start * Starting periodic command scheduler cron [ OK ] be4@indy3:~$ cron cron: can't open or create /var/run/crond.pid: Permission denied be4@indy3:~$ sudo service cron status * cron is running be4@indy3:~$ cd /var/run be4@indy3:/var/run$ ll -rw-r--r-- 1 root root 6 Oct 25 09:12 crond.pid be4@indy3:/var/run$ crontab -eno crontab for be4 - using an empty one Select an editor. To change later, run 'select-editor'. 1. /bin/nano ---- easiest 2. /usr/bin/vim.basic 3. /usr/bin/vim.tiny 4. /bin/ed Choose 1-4 [1]: 2 crontab: installing new crontab # exécuter à 09:30 le 25 octobre 30 9 25 10 * /bin/bash -lc 'echo "one-shot $(date)" > /tmp/cron_one_shot.log' # 25.10.2025 via le script cela fonctionne (mais seul. si WSL est lancé) 54 10 * * * /home/be4/script/webcam_cron.sh
be4@indy3:~$ ls -albe4@indy3:~$ more .bashrc-rw------- 1 be4 be4 2872 Jun 11 01:28 .bash_history -rw-r--r-- 1 be4 be4 220 Mar 25 11:04 .bash_logout -rw-r--r-- 1 be4 be4 3879 Mar 25 16:49 .bashrc # changer PS1 de bleu(34)/fond_noir à cyan(36)/fond_noir be4@indy3:~$ echo $PS1if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" ;; *) ;; esac be4@indy3:~$\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ mais toutes les couleurs sont pas terribles! why? ex: "vi" illisible be4@indy3:~$ more .bashrcPS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ ' be4@indy3:/mnt/d/data_html/c# find . -name "*.htm" -exec grep "< nav>" {} \; -print |wc -l 28# aliases ------------ alias ll='ls -alF' alias llt='ls -altr' alias la='ls -A' alias l='ls -CF' alias cdd='cd /mnt/d/data_html' alias cdbe4='cd /mnt/d/data_html/internet/be4.free.fr' alias macam1='now=`date +"%Y%m%d_%H%M"`; curl http://www.trinum.com/ibox/ftpcam/markstein_la-federale.jpg > /mnt/d/webcam_markstein_${now}.jpg' # find + tar ... No, no ... yesfind . -name "*.htm" -exec grep " erreur si space in name!190 tar -tvf all_gzip_2020-06-18.tar 191 find . -name "*.htm" -mtime 0 -exec tar -rvf out.tar {} \; 192 ls -l out.tar 193 tar -tvf 194 tar -tvf out.tar 195 find . -name "*.htm" -mtime 0 -exec tar -rvf sv_$(date +%Y-%m-%d).tar {} \; 196 tar -tvf out.tar 197 ls -l *.tar 198 rm all_gzip_2020-06-18.tar 199 rm out.tar 200 find . -mtime 0 -exec tar -rvf sv_$(date +%Y-%m-%d).tar {} \; 201 ls -l *.tar 202 rm sv_2020-06-18.tar 203 find . -name "*.gpx" -mtime 0 -exec tar -rvf sv_$(date +%Y-%m-%d).tar {} \; 204 find . -name "*.gpx" -exec tar -rvf sv_$(date +%Y-%m-%d).tar {} \; 205 ls -ltr 206 mv sv_2020-06-18.tar sv_gpx_2020-06-18.tar 207 gzip sv_gpx_2020-06-18.tar 208 ls -ltr *gz 209 find . -name "*.gpx" | xargs tar cfvz sv2_gpx_$(date +%Y-%m-%d).tgz 210 ls -ltr *gz
voir aussi grep (find/tar)