0% found this document useful (0 votes)
4 views5 pages

WSL Update and Script Management Guide

Windows Subsystem for Linux (WSL) is now available in the Microsoft Store, allowing users to upgrade easily and receive the latest updates. The document includes system information for Ubuntu 24.04.1 LTS and provides examples of basic shell scripting commands and their outputs. Users can create and execute scripts, manage files, and troubleshoot errors within the WSL environment.

Uploaded by

abshrcode
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

WSL Update and Script Management Guide

Windows Subsystem for Linux (WSL) is now available in the Microsoft Store, allowing users to upgrade easily and receive the latest updates. The document includes system information for Ubuntu 24.04.1 LTS and provides examples of basic shell scripting commands and their outputs. Users can create and execute scripts, manage files, and troubleshoot errors within the WSL environment.

Uploaded by

abshrcode
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Windows Subsystem for Linux is now available in the Microsoft Store!

You can upgrade by running '[Link] --update' or by visiting [Link]

Installing WSL from the Microsoft Store will give you the latest WSL updates, faster.

For more information please visit [Link]

Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64)

* Documentation: [Link]

* Management: [Link]

* Support: [Link]

System information as of Mon Oct 21 10:14:27 UTC 2024

System load: 0.52

Usage of /home: unknown

Memory usage: 47%

Swap usage: 1%

Processes: 8

Users logged in: 0

IPv4 address for wifi0: [Link]

IPv6 address for wifi0: 2401:4900:1c65:56d5:1090:71a9:e5d5:7ab9

IPv6 address for wifi0: 2401:4900:1c65:56d5:2c21:2c69:e10c:8f9e

This message is shown once a day. To disable it please create the

/root/.hushlogin file.
root@DESKTOP-0AJV3O8:~# ls

root@DESKTOP-0AJV3O8:~# grep '^root' /etc/passwd

root:x:0:0:root:/root:/bin/bash

root@DESKTOP-0AJV3O8:~# sudo passwd root

New password:

Retype new password:

passwd: password updated successfully

root@DESKTOP-0AJV3O8:~# su -

root@DESKTOP-0AJV3O8:~# echo $0

-bash

root@DESKTOP-0AJV3O8:~# cat /etc/shells

# /etc/shells: valid login shells

/bin/sh

/usr/bin/sh

/bin/bash

/usr/bin/bash

/bin/rbash

/usr/bin/rbash

/usr/bin/dash

/usr/bin/tmux

root@DESKTOP-0AJV3O8:~# pwd

/root

root@DESKTOP-0AJV3O8:~# ls

root@DESKTOP-0AJV3O8:~# mkdir myScripts

root@DESKTOP-0AJV3O8:~# ls
myScripts

root@DESKTOP-0AJV3O8:~# cd myScripts/

root@DESKTOP-0AJV3O8:~/myScripts# vi 01_basic.sh

root@DESKTOP-0AJV3O8:~/myScripts# cat 01_basic.sh

#!/bin/bash

#echo "Hey Buddy!"

root@DESKTOP-0AJV3O8:~/myScripts# chmod +x 01_basic.sh

root@DESKTOP-0AJV3O8:~/myScripts# ./01_basic.sh

root@DESKTOP-0AJV3O8:~/myScripts# vi 01_basic.sh

root@DESKTOP-0AJV3O8:~/myScripts# chmod +x 01_basic.sh

root@DESKTOP-0AJV3O8:~/myScripts# ./01_basic.sh

Hey Buddy!

root@DESKTOP-0AJV3O8:~/myScripts# ls -ltr

total 0

-rwxr-xr-x 1 root root 32 Oct 21 11:55 01_basic.sh

root@DESKTOP-0AJV3O8:~/myScripts# pwd

/root/myScripts

root@DESKTOP-0AJV3O8:~/myScripts# cd

root@DESKTOP-0AJV3O8:~# pwd

/root

root@DESKTOP-0AJV3O8:~# cd myScripts

root@DESKTOP-0AJV3O8:~/myScripts# vi 02_comments.sh

root@DESKTOP-0AJV3O8:~/myScripts# bash 02_comments.sh

checking comments
root@DESKTOP-0AJV3O8:~/myScripts# cat 02_comments.sh

#!/bin/bash

echo "checking comments"

#This is a single line comment.

root@DESKTOP-0AJV3O8:~/myScripts# vi 02_comments.sh

root@DESKTOP-0AJV3O8:~/myScripts# bash 02_comments.sh

checking comments

root@DESKTOP-0AJV3O8:~/myScripts# bash 02_comments.sh

checking comments

root@DESKTOP-0AJV3O8:~/myScripts# vi 02_comments.sh

root@DESKTOP-0AJV3O8:~/myScripts# vi 02_comments.sh

root@DESKTOP-0AJV3O8:~/myScripts# chmod +x 02_comments.sh

root@DESKTOP-0AJV3O8:~/myScripts# ./01_basic.sh

Hey Buddy!

root@DESKTOP-0AJV3O8:~/myScripts# ./02_comments.sh

checking comments

root@DESKTOP-0AJV3O8:~/myScripts# vi 02_comments.sh

root@DESKTOP-0AJV3O8:~/myScripts# ls

01_basic.sh 02_comments.sh

root@DESKTOP-0AJV3O8:~/myScripts# vi [Link]

root@DESKTOP-0AJV3O8:~/myScripts# bash [Link]

[Link]: line 9: unexpected EOF while looking for matching `"'


root@DESKTOP-0AJV3O8:~/myScripts# vi [Link]

[No write since last change]

/bin/bash: line 1: wq: command not found

shell returned 127

Press ENTER or type command to continue

root@DESKTOP-0AJV3O8:~/myScripts# bash [Link]

[Link]: line 9: unexpected EOF while looking for matching `"'

root@DESKTOP-0AJV3O8:~/myScripts# vi [Link]

[No write since last change]

/bin/bash: line 1: wq: command not found

shell returned 127

Press ENTER or type command to continue

root@DESKTOP-0AJV3O8:~/myScripts# bash [Link]

my name is Prashant and age is 20.

root@DESKTOP-0AJV3O8:~/myScripts#

You might also like