Linux Playground
Below are some Bash examples. Click "Execute" to run the commands.
Basic Commands - Runs in our ELKS wasm
Check Current Path
Print the current working directory.
pwd
Create a Directory
Use mkdir to create a new directory named test1.
mkdir test1
List Directory
List files and folders in the current directory.
ls -la
Change Directory
Navigate to the test1 directory you created.
cd test1
Create a File
Create a file named hello.txt inside test1.
touch hello.txt
Write to a File
Append "Hello, World!" to hello.txt.
echo "Hello, World!" >> hello.txt
View File Contents
Display the contents of hello.txt.
cat hello.txt
Check File Type
Display the type of a file or directory.
file hello.txt
Go to the Parent Directory
Move one level up in the file system.
cd ..
Go to the Root Directory
Move to the root of the file system.
cd /
Create Another Directory
Create a second directory named test2.
mkdir test2
Copy a File
Copy hello.txt from test1 to test2 directory.
cp test1/hello.txt test2/
Move a File
Move hello.txt from test1 to test2.
mv test1/hello.txt test2/
Delete a File
Remove the hello.txt file from test2.
rm test2/hello.txt
Remove a Directory
Delete the test2 directory.
rmdir test2
Check Disk Usage
Show disk usage statistics.
df -h
List Running Processes
Display all currently running processes.
ps aux
Kill a Process
Terminate a process with a given PID (replace PID with an actual number).
kill PID
Find a File
Search for a file named hello.txt in the current directory.
find . -name "hello.txt"
Search Inside Files
Search for the word "error" inside all .log files.
grep "error" *.log
Check System Uptime
Check how long the system has been running.
uptime
Clear Terminal Screen
Clear all text in the terminal.
clear
Advanced Commands - Requires advanced wasm to run
Or, you can try these in your linux cmd or windows wsl
Check Memory Usage
Display memory usage information.
free -m
Display Environment Variables
Show all system environment variables.
env
Check Network Connectivity
Ping google.com to check network connectivity.
ping -c 4 google.com
Show Network Configuration
Display network interfaces and their IP addresses.
ifconfig
Create a New User
Create a new user named "newuser" (requires root privileges).
sudo useradd -m newuser
Switch User
Switch to the newly created user "newuser".
su newuser
Change User Password
Set a new password for "newuser".
passwd newuser
Check Open Ports
List active network connections and open ports.
netstat -tulnp
Monitor System Usage
View system performance in real-time.
top
Show Logged-in Users
List all currently logged-in users.
who