Initially from [[http://www.stchman.com/ubuntu_cli.html|here]]\\
^Purpose^Command^
|/bin/sh|change to the bourne shell|
|/bin/csh|change to the C-shell|
|/bin/bash|change to the bash shell (Ubuntu default)|
|echo $SHELL|show which shell you are currently using|
|pwd|print working directory, displays the directory that the terminal is pointing to|
|echo $PATH|show your current path|
|<nowiki>ls -d */ or ls -l | grep "^d"</nowiki>|list directories only|
|<nowiki>ls -l | grep -v "^d"</nowiki>|list files only|
|<nowiki>> <file_name></nowiki>|redirect output to a text file, ex: ls -l <nowiki>></nowiki> files.txt\\ This will create a file called files.txt with the output of ls -l, warning if any files with name files.txt will be erased in favor of new file|
|<nowiki>>> <file_name></nowiki>|similar to redirect except that an existing file will be appended to on the end of the file|
|echo $USER or whoami|show which user is currently logged in|
|cd ~|change to the currently logged in user's home directory|
|echo $HOME|displays the currently logged in users home directory|
|ln -s <path> <location of link>|create a symbolic link to a file or folder, a shortcut by another name|
|sudo fdisk -l|shows you all the partitions available mounted or unmounted|
|sudo dpgk -i <.deb package>|install a debian package, *.deb will install a series of debian packages|
|dpkg -l|list all packages installed on your PC, follow with <nowiki>|</nowiki> grep <string> to find a certain package|
|sudo apt-get update|update the package manager|
|sudo apt-get install <package(s)>|install packages, there can be multiple packages each separated by a space|
|ps -ef|list all processes running, follow with <nowiki>|</nowiki> grep <string> to list a processes|
|shred -fuz <filename>|completely remove file from media, shred overwrites files with zeroes|
|rm -rf <folder>|wipe files AND folders recursively, VERY dangerous command|
|wipe -rf <folder>|securely wipe files AND folders recursively, VERY dangerous command|
|kill [-9] <process id>|terminate a process, process number can be gotten from the ps -ef command, the -9 means to kill without anymore input|
|df -k|list free disk space of all partitions in kilobytes|
|wget <website>|retrieves a file from a website using http or ftp|
|ifconfig -a|give information about all networking interfaces|
|iwconfig|tests to see if network interfaces have wireless connectivity|
|lspci|list of devices connected to the PC via PCI|
|lsusb|list of devices connected to the PC via USB|
|gksudo gedit /etc/X11/xorg.conf|allows editing of the xorg.conf using gedit for X-Server|
|gksudo gedit /etc/fstab|allows editing of the fstab using gedit for mounting drives|
|sudo mount -a|mounts all mount points specified by your /etc/fstab file|
|sudo umount -a|un-mounts all mount points specified by your /etc/fstab file|
|sudo fc-cache -f -v|adds fonts for usage by applications|
|sudo apt-get clean|remove cached .deb packages that apt-get uses during installation|
|sudo apt-get autoremove <package>|removes package and the package dependencies|
|sudo /etc/init.d/networking restart|restart network manager|
|sudo /etc/init.d/cupsys restart|restart CUPS|
|firefox localhost:631|CUPS web based manager|
|sudo dpkg-reconfigure xserver-xorg|reconfigure your xorg.conf file|
|<command> &|follow shell commands with the & character, example: gksudo gedit /etc/fstab & will free terminal up for other commands|
|uname -r|information of what kernel you are using|
|find <dir> -exec grep "<string>" '{}' \; -print|find all files recursively cantaining <string> in directory <dir>, wildcards allowed|
|find -name <filename>|find files recursively cantaining <filename>, wildcards allowed|
|gnome-terminal --geometry=WxH|sizes the gnome-terminal where W=width and H=height in columns|
|cat /proc/cpuinfo|information on CPU|
|cat /proc/meminfo|information on RAM|
|sudo /etc/init.d/nfs-kernel-server restart|restart NFS networking service, can use start and stop as well|
|sudo /etc/init.d/samba restart|restart Samba service, can use start and stop as well|
|sudo smbpasswd -L -a <username>|create Samba user and set user password for Samba <username>|
|sudo passwd <username>|create new password for user <username>|
|du -cb <folder>|show disc space used in bytes of <folder>|
|find . -depth -print0 <nowiki>|</nowiki> cpio --null --sparse -pvd <dest>|create exact copy of current folder to <dest>, use sudo if needed|
|k3b --nofork|allow k3b to run multiple instances|
|cat /etc/issue|tell what version of Ubuntu you are running|