{{tag>english linux debian cheatsheet collection}} ====== Linux Commands Cheatsheet ====== ===== Command list ===== ==== User Management ==== ^ Command ^ Comment ^ | /usr/bin/ftptop | Display information about ProFTPd | | adduser | create user with additional information incl. homedir | | passwd | Change password | | su | set user | | sudo -u www-data command | Execute command as user www-data | | useradd -d | create user with home dir | | userdel | delete user | | whoami | Output current user | ==== File and directory management ==== ^ Command ^ Comment ^ | chgrp | Change group | | chown | Change owner | | cp -r newdir/* olddir/ | Copy files recursively | | 'cp' -rf dir/{*,.??*} /dir/ | hidden files and aliased cp -i will be copied | | du -hs | specify directory size | | du -h * %%|%% sort -hr > /home/user/filelist.txt | File list sorted by size | | echo bla > 1.txt | Create file 1.txt with content bla | | 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 | | pwd | Output working directory | | tar xfz u-web-my4.tgz | extract file | | whereis | Output binary directory | ==== Package management ==== ^ Command ^ Comment ^ | apt-cache search | search for a package | | apt-get install | install pack | | apt-get update | update package cache | | apt-get upgrade | upgrade installed packages | ==== System Management ==== ^ Command ^ Comment ^ | cat /proc/cpuinfo | cpuinfo | | cat /proc/meminfo | RAM Info | | cat /proc/version | Deb Version | | crontab -e | Edit cronjobs | | crontab -l | Listen to cronjobs | | date +%s | Output Unix time | | date -d @1234631164 | Output Unix time in normal time | | df -h | free disc space | | dpkg-reconfigure locales -plow | Language settings | | dpkg-reconfigure tzdata | Time zone settings | | kill -6 ((PID denotes the process ID)) | SIGABRT - Cancel process | | kill -9 | SIGKILL - Terminate process | | kill -15 | SIGTERM - terminate process cleanly | | kill -18 | SIGCONT - Continue process | | kill -19 | SIGSTOP - Stop process | | mount -o remount -rw / | release read-only file system | | ps | process list | | ps -aux | detailed process list | ==== Netzwerk Management ==== ^ Command ^ Comment ^ | ifconfig | Display IP address and netmask | | netstat -pantu | Connections/Ports | | nload -u H | Display bandwidth | | sh blubb.sh | sh file executen | | wget http://www.psoft.net/shiv/HS/u-web-my4.tgz | gets file | ==== Start und Stop ==== ^ Command ^ Comment ^ | shutdown -s | Shut down or switch off | | shutdown -r | Restart (reboot) | | shutdown -l | User logout | | shutdown -s -f | Forced shutdown | ===== Linux Zeit ändern ===== Set the time under Linux. ((http://yellowpad.info/linux/date_time.asp)) [me@mybox me]$ su password: Check the current date and time of the Linux box by entering: [root@mybox me]# date 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: [root@mybox me]# date 040713032004 would change the time and yield: [root@mybox me]$ Wed Apr 7 13:03:00 EDT 2004 ===== Load Apache modules ===== a2enmod modname or activate it with a2dismod modname deaktivieren. The web server must then be restarted with /etc/init.d/apache2 restart nötig. ===== Run Froxlor Cron ===== [[linux:froxlor_reload|]]