Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:linux:befehle [2023/10/24 21:13] – angelegt psycore | en:linux:befehle [2024/08/23 11:13] (current) – psycore | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Linux commands | + | {{tag> |
- | + | ====== Linux Commands Cheatsheet | |
- | My collection of commands for [[wpen> | + | |
===== Command list ===== | ===== Command list ===== | ||
Line 8: | Line 7: | ||
^ Command ^ Comment ^ | ^ Command ^ Comment ^ | ||
- | | / | + | | / |
| adduser < | | adduser < | ||
- | | passwd < | + | | passwd < |
| su < | | su < | ||
- | | sudo shutdown | + | | sudo -u www-data command |
| useradd -d < | | useradd -d < | ||
| userdel < | | userdel < | ||
| whoami | Output current user | | | whoami | Output current user | | ||
- | ==== File and Directory Management | + | ==== File and directory management |
^ Command ^ Comment ^ | ^ Command ^ Comment ^ | ||
| chgrp < | | chgrp < | ||
| chown < | | chown < | ||
- | | cp -r newdir/* olddir/ | copy files recursively | | + | | cp -r newdir/* olddir/ | Copy files recursively | |
| ' | | ' | ||
| du -hs <dir> | specify directory size | | | du -hs <dir> | specify directory size | | ||
- | | du -h * %%|%% sort -hr > / | + | | du -h * %%|%% sort -hr > / |
| echo bla > 1.txt | Create file 1.txt with content bla | | | echo bla > 1.txt | Create file 1.txt with content bla | | ||
| echo blabla >> 1.txt | Append blabla to file 1.txt | | | echo blabla >> 1.txt | Append blabla to file 1.txt | | ||
+ | | ls | List directory contents | | ||
+ | | ls -la dir | List directory contents with user information | | ||
| ls -lahS $(find / -type f -size +100000k) | search for files > 100MB | | | ls -lahS $(find / -type f -size +100000k) | search for files > 100MB | | ||
- | | ls -la dir | listing | | + | | pwd | Output |
- | | pwd | output | + | |
| tar xfz u-web-my4.tgz | extract file | | | tar xfz u-web-my4.tgz | extract file | | ||
| whereis | Output binary directory | | | whereis | Output binary directory | | ||
Line 49: | Line 49: | ||
| cat / | | cat / | ||
| crontab -e | Edit cronjobs | | | crontab -e | Edit cronjobs | | ||
- | | crontab -l | List cronjobs | | + | | crontab -l | Listen to cronjobs | |
| date +%s | Output Unix time | | | date +%s | Output Unix time | | ||
- | | date -d @1234631164 | output | + | | date -d @1234631164 | Output |
- | | df -h | free disk space | | + | | df -h | free disc space | |
| dpkg-reconfigure locales -plow | Language settings | | | dpkg-reconfigure locales -plow | Language settings | | ||
| dpkg-reconfigure tzdata | Time zone settings | | | dpkg-reconfigure tzdata | Time zone settings | | ||
- | | kill -6 <PID> ((PID denotes the process ID)) | SIGABRT - Abort process | | + | | kill -6 <PID> ((PID denotes the process ID)) | SIGABRT - Cancel |
- | | kill -9 <PID> | SIGKILL - terminate | + | | kill -9 <PID> | SIGKILL - Terminate |
| kill -15 <PID> | SIGTERM - terminate process cleanly | | | kill -15 <PID> | SIGTERM - terminate process cleanly | | ||
| kill -18 <PID> | SIGCONT - Continue process | | | kill -18 <PID> | SIGCONT - Continue process | | ||
- | | kill -19 <PID> | SIGSTOP - stop process | | + | | kill -19 <PID> | SIGSTOP - Stop process | |
- | | mount -o remount -rw / | release | + | | mount -o remount -rw / | release |
+ | | ps | process list | | ||
+ | | ps -aux | detailed process list | | ||
- | ==== Network | + | ==== Netzwerk |
^ Command ^ Comment ^ | ^ Command ^ Comment ^ | ||
- | | ifconfig | show IP address and netmask | | + | | ifconfig | Display |
| netstat -pantu | Connections/ | | netstat -pantu | Connections/ | ||
- | | nload -u H | Show bandwidth | | + | | nload -u H | Display |
- | | sh blubb.sh | sh file execute | + | | sh blubb.sh | sh file executen |
| wget http:// | | wget http:// | ||
- | ==== Start and stop ==== | + | ==== shutdown options |
^ Command ^ Comment ^ | ^ Command ^ Comment ^ | ||
- | | shutdown -s | Shut down or switch off the system | + | | shutdown -s | Shut down or switch off | |
| shutdown -r | Restart (reboot) | | | shutdown -r | Restart (reboot) | | ||
| shutdown -l | User logout | | | shutdown -l | User logout | | ||
- | | shutdown -s -f | forced | + | | shutdown -s -f | Forced |
- | ===== Change Linux time ===== | + | ===== change system |
- | Set the time under Linux. ((http://yellowpad.info/linux/date_time.asp)) | + | Set the time under Linux. ((https://wiki.ubuntuusers.de/Systemzeit/)) |
+ | |||
+ | ==== show time ==== | ||
<code bash> | <code bash> | ||
- | [me@mybox me]$ su | + | timedatectl |
- | password: | + | </ |
- | Check the current date and time of the Linux box by entering: | + | ==== change |
- | [root@mybox me]# date | + | Set time zone manually |
- | Linux yields the current settings: | + | |
- | [root@mybox me]# Wed Apr 7 12:03:45 EDT 2004 | + | |
- | Change the current time and date of the Linux box by entering: | + | <code bash> |
- | [root@mybox me]# date 040713032004 | + | sudo timedatectl set-timezone Europe/ |
- | would change the time and yield: | + | </ |
- | [root@mybox me]$ Wed Apr 7 13:03:00 EDT 2004 | + | |
+ | Select | ||
+ | |||
+ | <code bash> | ||
+ | sudo dpkg-reconfigure tzdata | ||
</ | </ | ||
Line 105: | Line 111: | ||
</ | </ | ||
- | activate, | + | or activate it with |
<code bash> | <code bash> | ||
Line 111: | Line 117: | ||
</ | </ | ||
- | deactivate. Subsequently, | + | deaktivieren. The web server |
<code bash> | <code bash> | ||
Line 117: | Line 123: | ||
</ | </ | ||
- | is necessary. | + | nötig. |
===== Run Froxlor Cron ===== | ===== Run Froxlor Cron ===== | ||
- | [[en:linux:froxlor: | + | [[en:linux:froxlor_reload|]] |