SIMULATORI · LINUX CLI · IMPARA LA SHELL

Linux CLI nel browser

A simulated Bash shell written in pure JavaScript, with a virtual filesystem in memory and ~35 real commands (ls, cd, cat, grep, find, pipe, redirect, chmod, ps, etc.). Instant boot, ~30 KB. Learn the command line with 15 hands-on lessons alongside a working shell. No emulator, no kernel — just the commands as you would type them on a real Linux.

Linux Shell Simulator — instant boot. Click inside terminal and type commands.
15 hands-on lessons

Click on a lesson to expand. Type the commands in the terminal on the left.

01. Navigation
Your first command: pwd — shows where you are in the filesystem.
Then ls to list files, ls -la to see all (hidden included).
Change directory with cd /etc, back home with cd ~.
Try:
$ pwd
$ ls
$ ls -la
$ cd /etc
$ ls
$ cd ~
02. Reading files
cat file.txt shows the whole content.
less file opens in pager (space to scroll, q to exit).
head -20 file first 20 lines, tail -20 file last 20.
Try:
$ cat /etc/hostname
$ less /etc/passwd
$ head /etc/passwd
$ tail /etc/passwd
03. Creating files
touch new.txt creates empty file.
echo "hello" > file.txt writes string (overwrites).
echo "line2" >> file.txt appends at end.
mkdir folder creates directory.
Try:
$ touch prova.txt
$ echo "hello" > prova.txt
$ cat prova.txt
$ mkdir nuova
$ ls
04. Copy / move / remove
cp source dest, cp -r for whole directories.
mv old new moves or renames.
rm file deletes, rm -rf folder recursive (careful!).
Try:
$ cp prova.txt copia.txt
$ ls
$ mv copia.txt copia2.txt
$ rm copia2.txt
$ ls
05. Permissions
Every file has 3 permissions (r=read w=write x=execute) for 3 groups (user/group/other).
ls -l shows -rwxr--r--.
chmod 755 file = rwx-r-x-r-x.
chmod +x script.sh adds executable.
Try:
$ ls -l
$ chmod 600 prova.txt
$ ls -l prova.txt
$ chmod +x prova.txt
$ ls -l prova.txt
06. File search
find /path -name "*.txt" search by name.
find / -size +10M files larger than 10 MB.
which cmd where is the executable.
locate word (uses indexed database).
Try:
$ find / -name "hostname" 2>/dev/null
$ which ls
$ which sh
07. grep
grep "word" file search string in file.
grep -r "word" . recursive search.
grep -i case-insensitive.
grep -v invert (show lines NOT containing).
Try:
$ grep root /etc/passwd
$ grep -c "^" /etc/passwd
$ grep -i BASH /etc/passwd
08. Pipe |
The real Unix superpower: chain commands together.
ls -la | grep txt filters ls output.
cat file | wc -l counts lines.
ps aux | grep sh find shell processes.
Try:
$ ls / | wc -l
$ cat /etc/passwd | grep root
$ ls -la | head -5
09. Redirect > < >>
> overwrites output to file.
>> appends without deleting.
< reads input from file.
2>/dev/null discards errors.
cmd > out.txt 2>&1 everything in one file.
Try:
$ ls / > listato.txt
$ cat listato.txt
$ echo "extra" >> listato.txt
$ wc -l < listato.txt
10. Processes
ps aux all processes.
top live monitor (q to exit).
kill 1234 terminate PID 1234.
kill -9 1234 forced (SIGKILL).
jobs, bg, fg background management.
Try:
$ ps
$ ps aux | head
$ ps aux | wc -l
11. Users & sudo
whoami who am I.
id UID + GID + groups.
su - user become another user.
sudo cmd run as root.
who who is logged in.
Try:
$ whoami
$ id
$ who
12. System
uname -a kernel/CPU info.
df -h disk space.
du -sh folder how much it takes.
free -h free RAM.
uptime how long running.
Try:
$ uname -a
$ df -h
$ free
$ uptime
13. Network
ip addr network interfaces.
ping host ICMP connectivity.
curl url fetches web page.
wget url download file.
netstat -tlnp listening ports.
Try:
$ ip addr
$ cat /etc/resolv.conf
14. Compression
tar -cvf archive.tar files/ creates tar.
tar -xvf archive.tar extracts.
tar -czvf archive.tar.gz files/ tar+gzip.
zip -r out.zip folder/, unzip file.zip.
Try:
$ tar -cvf mio.tar /etc/hostname
$ tar -tvf mio.tar
$ rm mio.tar
15. Text editors
nano file.txt opens editor.
Ctrl+O save, Ctrl+X exit.
Ctrl+K cut line, Ctrl+U paste.
For vim: vi file, i insert, Esc+:wq save+quit.
Try:
$ echo "test editors"
Shell tips
  • Tab autocompletes filenames and commands
  • / browse command history
  • Ctrl+R reverse search in history
  • Ctrl+C stops a running command
  • man cmd shows the manual (q to exit)
Legal notice — original code, zero external dependencies

This is a Bash shell simulator written from scratch in pure JavaScript by Alessandro Barone for this site. Virtual filesystem in memory, ~35 real commands. No emulator, no kernel, no ROM: nothing from third-party proprietary code. Perfect for learning the CLI without risk of breaking anything on your real system.