ls |
Lists file and directories |
ls-l |
cd <directory> |
change current directory |
cd /var/log |
pwd |
show current directory path |
pwd |
mkdir <name> |
creates a new directory |
mkdir backups |
rm <file> |
remove/delete file |
rm filename.txt |
rm -r <directory> |
remove directory and its contents |
rm -r foldername |
cp <source> <destination> |
copy files or directories |
cp file.txt /tmp/ |
mv <source> <destination> |
move or rename file or directories |
mv filename.txt newname.txt |
sudo apt update |
Update package lists |
sudo apt update |
sudo apt upgrade |
upgrade installed packages |
sudo apt upgrade -y |
cat <file> |
Display contents of a file |
cat /etc/hostname |
tail -f <file> |
view live long output |
tail -f /var/log/syslog |
chmod |
change file/directory permissions |
chmod +x script.sh |
chown |
Change file/directory owner |
sudo chown user:user file.txt |
scp <file> user@host:path |
securely copy file between local and remote machines |
scp file.txt user@192.168.1.10:/home/user/ |
ssh user host |
Secure shell login to remote machine |
ssh user@192.168.1.10 |
rsync |
Sync files/directories locally or remotely |
rsync -avz /src/ user@host:/dest/ |
df -h |
show disk space usage in human-readable format |
df -h |
du -sh <directory> |
show size of a directory or file |
du -sh /var/log |
ps aux |
show running processes |
ps aux |
kill <PID> |
Terminate a process by its process ID |
kill 1234 |
systemctl status <service> |
check status of a systemd service |
systemctl status nginx |
systemctl start <service> |
starts a systemd service |
systemctl start nginx |
systemctl stop <service> |
stops a systemd service |
systemctl stop nginx |
journalctl -xe |
View system logs with extra details |
journalctl -xe |
wget <url> |
Download files from the internet |
wget https://example.com/file.zip |
curl <url> |
Transfer data from or to a server |
curl -O https://example.com/file.zip |
|
|
|