Ubuntu Commands PDF
Ubuntu Commands PDF
1. sudo <command> To run any command as superuser (root). 2. sudo -u <user> <command> To run a command as any other user -> 3. passwd To change your password. 4. sudo visudo To edit the sudoers file to change sudo permissions. 5. gksudo <command> Graphical sudo application APT get commands 1. apt-get update To update the package database 2. apt-get upgrade To upgrade the packages 3. apt-get dist-upgrade To upgrade the current distribution 4. apt-cache search <string> To search for a particular package 5. apt-get autoremove <package name> To remove a package 6. apt-get install <package name> To install package 7.apt-cache showpkg <package name> Show package information 8. apt-get -f install Fix broken package 9. vi /etc/apt/sources.list Edit package repository information using the vi editor 10. gedit /etc/apt/sources.list Edit package repository information using the gedit editor System Commands 1. uname -r Get kernel version 2. uname -a Get all information about the system (architecture, kernel, OS etc) 3. sudo reboot reboot OS 4. sudo shutdown -h now Shutdown computer 5. fsck Utility to check the filesystem for inconsistency. eg. fsck /dev/sdb 6. mount Utility to mount a filesystem. eg. mount -t ext4 /dev/sdb1 /mnt/sdb1 Display Commands 1. Ctrl+Alt+backspace Restart X-server if it is hung 2. /etc/x11/xorg.conf X11 configuration file 3. /etc/init.d/gdm restart Restart the GDM graphical login daemon 4. Ctrl+alt+F<n> Switch to tty <n> 5. Ctrl+alt+F7 Switch back to X Restore from system crash Press and hold down ALT + SysRq (PrintScn) button and type phrase R E I S U B with 1 second interval between each letter. Your system will magically recover from the crash and reboot itself.