Common Ubuntu commands and tips
From: http://www.iteye.com/topic/148375
Sudo apt-Get install software name install software command
Sudo Nautilus open the file (with root permission)
Switch su root to "root"
Ls to list current directory files (excluding hidden files)
Ls-A: List the current directory files (including hidden files)
Ls-l lists the details of files in the current directory
CD .. back to the upper-level directory of the current directory
CD-Return to the last directory
Cd ~ Or CD back to the current user's home directory
Create a directory by mkdir directory name
Rmdir empty directory name: delete an empty directory
RM file name delete one or more files
Rm-RF: the non-empty directory name deletes everything in a non-empty directory.
MV path/file/path/file move the files under the relative path to the absolute path
The new MV file name is renamed under the current directory.
Find path-name "string" searches for the files and directories that match the string within the path range
Fdisk-l view system partition information
Fdisk/dev/SDB partitions a new SCSI hard disk.
Chown root/Home: Change the owner of/home to the root user.
Chgrp root/Home: Change the/home group to the root group.
Useradd creates a new user
Groupadd group name: Create a new group
Passwd user name creates a password for the user
Passwd-D: the user name can also be used to delete user passwords.
Passwd-s user name query account and password
Usermod-l new username old username rename User Name
Userdel-r user name delete all user information
Tar-C create package-x release package-V display command process-Z represents the compressed package
Tar-CVF benet.tar/home/Benet package the/home/Benet directory
Tar-zcvf benet.tar.gz/mnt package and compress the Directory
Decompress the tar-zxvf benet.tar.gz package and restore it.
Tar-jxvf benet.tar.bz2 Extract
Make Compilation
Make install the compiled source code package
Reboot init 6 restart Linux
Halt init 0 shutdown-H now shut down the Linux System
Uname-a view kernel version
Run CAT/etc/issue to check the Ubuntu version.
Lsusb viewing USB devices
Sudo ethtool eth0 view Nic status
CAT/proc/cpuinfo view CPU Information
Lshw view current hardware information
Sudo fdisk-l view disk Information
DF-h to view the remaining disk space
Free-m to view the current memory usage
PS-a to check which processes are running
Kill process number (the number in the first column of PS-A) or killall process name (killing a process)
Kill-9 process number forcibly kills a process
Common apt commands:
Apt-cache search package
Apt-Cache show package obtains package information, such as description, size, and version.
Sudo apt-Get install package installation package
Sudo apt-Get install package--reinstall re-installation package
Sudo apt-get-F install fix and install "-F =-fix-missing"
Sudo apt-Get remove package Delete package
Sudo apt-Get remove package--Purge delete a package, including deleting a configuration file.
Sudo apt-Get Update update source
Sudo apt-Get upgrade updates installed packages
Sudo apt-Get dist-upgrade System
Sudo apt-Get dselect-upgrade using dselect
Apt-Cache depends package for dependency usage
Apt-Cache rdepends package is used to check which packages are dependent on this package.
Sudo apt-Get build-dep package installation-related compilation environment
Apt-Get source packageSource code
Sudo apt-Get Clean & sudo apt-Get autoclean clear useless packages
Sudo apt-Get check whether any corrupted dependency exists
Clear all software caches (that is, Deb packages cached in the/var/Cache/APT/archives directory)
Sudo apt-Get clean
Delete isolated software that is no longer used by the System
Sudo apt-Get autoremove