terminal

root@cheat

Filtering by:beginnercloseClear

free -h

Display memory usage in human-readable format. Shows RAM and swap usage statistics.

$ free -h free -m watch free -h
systembeginner

ping

Send ICMP echo requests to test network connectivity. -c flag limits the number of packets.

$ ping -c 4 8.8.8.8 ping -i 2 google.com
networkbeginner

uname -a

Print detailed system information including kernel name, version, hostname, and architecture.

$ uname -a uname -r uname -m
systembeginner

whoami

Print the current username. Shows which user account is currently active in the terminal.

$ whoami
usersbeginner

uptime

Show how long the system has been running, number of users logged in, and system load averages.

$ uptime uptime -p
systembeginner

head

Display the first lines of a file. Default shows first 10 lines, -n specifies number of lines.

$ head -n 5 /etc/passwd head -c 100 file.txt
filesbeginner

cat

Display file contents. Concatenate and display files to standard output.

$ cat file.txt cat file1.txt file2.txt > combined.txt
filesbeginner

touch

Create an empty file or update file timestamps. If the file exists, updates its modification time.

$ touch newfile.txt touch -d '2024-01-01' file.txt
filesbeginner

mkdir -p

Create directories including parent directories. The -p flag creates parent directories as needed.

$ mkdir -p /var/www/html/assets/css
filesbeginner

cd

Change the current directory. Navigate to different folders in the file system.

$ cd /var/log cd ~ cd ..
filesbeginner

pwd

Print the current working directory path. Shows the full path of where you are in the file system.

$ pwd # Output: /home/user/documents
filesbeginner

ls

List all files including hidden ones with detailed information

$ ls -la /home/user
filesbeginner