- هذا الموضوع فارغ.
- Post
-
- ديسمبر 15, 2024 الساعة 5:57 م
Weekend Wikiمدير عامHere are examples for each of the commands listed. Replace placeholders (e.g.,
<file>
,<package>
,<directory>
) with actual values on your Ubuntu system:
System Information
uname -a
Example:uname -a
Output:
Linux ubuntu-PC 5.15.0-60-generic #66-Ubuntu SMP x86_64 GNU/Linux
.lsb_release -a
Example:lsb_release -a
Output: Ubuntu version details.
hostnamectl
Example:hostnamectl
Output: Hostname and OS details.
uptime
Example:uptime
Output:
08:24:56 up 1:23, 3 users, load average: 0.01, 0.02, 0.00
.df -h
Example:df -h
Output: Disk space usage (e.g.,
/dev/sda1 50G 25G 25G 50% /
).
File and Directory Management
ls
Example:ls -la
Output: Lists all files, including hidden ones, with detailed info.
cd <directory>
Example:cd /var/log
pwd
Example:pwd
Output:
/var/log
.mkdir <directory>
Example:mkdir my_project
rm <file>
Example:rm sample.txt
cp <source> <destination>
Example:cp file1.txt /tmp/file1.txt
mv <source> <destination>
Example:mv old_name.txt new_name.txt
Package Management
sudo apt update
Example:sudo apt update
sudo apt upgrade
Example:sudo apt upgrade
sudo apt install <package>
Example:sudo apt install curl
sudo apt remove <package>
Example:sudo apt remove curl
dpkg -l
Example:dpkg -l
User Management
whoami
Example:whoami
Output:
ubuntu
.id
Example:id
Output:
uid=1000(ubuntu) gid=1000(ubuntu)
.sudo adduser <username>
Example:sudo adduser john
sudo deluser <username>
Example:sudo deluser john
Process Management
ps aux
Example:ps aux
top
Example:top
kill <PID>
Example:kill 1234
pkill <process_name>
Example:pkill firefox
Networking
ip a
Example:ip a
ping <domain/IP>
Example:ping google.com
curl <URL>
Example:curl http://example.com
wget <URL>
Example:wget http://example.com/file.txt
File Permissions
chmod <permissions> <file>
Example:chmod 644 file.txt
chown <owner>:<group> <file>
Example:sudo chown ubuntu:ubuntu file.txt
System Monitoring and Logs
dmesg
Example:dmesg | tail
journalctl
Example:journalctl -u apache2.service
tail -f <logfile>
Example:tail -f /var/log/syslog
Archiving and Compression
tar -cvf archive.tar <files>
Example:tar -cvf backup.tar file1.txt file2.txt
tar -xvf archive.tar
Example:tar -xvf backup.tar
gzip <file>
Example:gzip file.txt
gunzip <file>
Example:gunzip file.txt.gz
System Utilities
sudo reboot
Example:sudo reboot
sudo shutdown now
Example:sudo shutdown now
history
Example:history
alias <name>='<command>'
Example:alias ll='ls -la'
Text File Management
cat <file>
Example:cat file.txt
nano <file>
Example:nano file.txt
less <file>
Example:less file.txt
grep <pattern> <file>
Example:grep 'error' file.txt
Let me know if you’d like examples tailored to a specific use case!
For consulting email us at [email protected]
- يجب تسجيل الدخول للرد على هذا الموضوع.