"Go" linux-ubuntu common Command Summary

Source: Internet
Author: User
Tags parent directory touch command

Transferred from: http://blog.csdn.net/simongeek/article/details/45271089

(i) Ubuntu basic command One

1. Help Man
--help simple help such as: Man tar or tar--help
Help command in more detail
Man command for the most detailed help
2. ls command
Ls-a Show all files and folders, including hidden files or folders
LS-L displays a full range of file information, including permissions, users, user groups, and more.
The LS--color displays files and folders, and is labeled with different colors.
3. Tab key
The tab command is used when your command is not complete, enter one and click to complete the completion, if there are multiple previous parts of the same command, then
Press the TAB key two times
4. Alias
Alias ubuntu= "LS" is used to alias a command. When you enter Ubuntu it is equivalent to entering the LS command.

(ii) Ubuntu basic commands two

1, which
The which command is used to find the directory where the command file you are executing resides.
2. Env
The current user's operating environment.
3. Echo
Echo $PSTH See what the path to the environment variable is, and the which command uses it to look up the command file in the directory of the environment variable
The directory that is stored, from front to back.
4. CMP
The cmp/bin/ls/bin/dir is used to compare whether two files are identical.
5. CP
CP/BIN/LS/BIN/A the command used to copy the file. Then you copy a command file and you can run the a command, which is the same as the LS usage.
6, Drwxr-xr-x
The preceding D indicates a folder, if-Indicates a file.
RWX indicates that the file owner has read and write execution permissions
R-x represents the permission read execution of the group where the file owner resides
R-x indicates that other people have permission to read execution.
7, chmod
Used to change the user's permissions for the file operation. chmod 0+r to add Read permissions. sudo chmod 0-r filename cancels the Read permission.
8, Lsattr
Used to display and set advanced properties for user files and directories.
9, Lsusb
Used to list the USB devices in the computer.
10, Lspci
Used to list the PCI devices in the computer.
11, Lsmod
There are two types of drivers under Linux. One is loaded into the kernel, and the other is in the form of modularity. Lsmod is used to
Lists the driver modules inside the computer.

(c) Ubuntu Basic command Three

1. Cat
The cat command is the command used to view the contents of the Ubuntu Chinese text file.
The cat/proc/cpuinfo is used to view the computer's CPU information.
Cat/proc/meminfo is used to view the internal information of a computer.
Cat/etc/issue View version information for Ubuntu.
2. Free
The free command is also used to view the intrinsic information in the Ubuntu computer.
3. grep
The grep command in Ubuntu is used to filter out information that is useful to you in a file.
Cat/proc/meminfo |grep Memtotal is used to filter out the memory size in memory.
4, more
The more command in Uubntu is used to display the results in pagination. Ls-a |more for pagination display.
5. Fdisk
The commands for viewing hard disk information in Ubuntu are in Fdisk.
6, Uname
The command to view the kernel version in Ubuntu is uname-a, and only input uname will output Linux as a result.

(iv) file Operation command:


1, LS
Format: LS directory
The LS command is used to display which files are under the file.
2. Touch
Format: Touch test1 test2 test3
The touch command is used to create files, and you can create multiple files at the same time.
3, RM
Format: RM file
The RM command is used to delete files, and when the file cannot be deleted, you can add the-F option to force the file to be deleted.
4. Cat
Format: Cat/proc/cpuinfo
The cat command is used to view information within a file. If you want to view only one item, add the grep option.
Example: Cat/proc/meminfo |grep memtotal
5. Less
Format: Less/proc/meminfo
The less command is also a command to view the contents of a file, but he displays it as a screen-by-screen display.
A, press the space bar to enter the next screen.
B. You can also move rows up or down by using the up and down keys.
C, press the Q key to exit the view.
6, more
Format: More/proc/meminfo
The more command, like the less command, is used to view the contents of a file, as well as a split-screen display.
A, press the space bar to enter the next screen
b, press the Q key to exit the view
7. CP
Format: Cp/etc/apt/sources.list/etc/aptsources.listbacker
The CP is a copy abbreviation for copying files.
8, MV
Format: mv/home/user1/Desktop/ruijie/xrgsu/usr/share/local/bin/xrgsu
The MV command is used to move files.
9. Find
Format: sudo find/-name ls
The Find command is used to find files:
A,/= The starting directory of the lookup,
B,-name with this option, show only the results that are found in the display.
C, LS is the directory file you are looking for.

(v) directory Operations Command:


1, mkdir
Format: mkdir home/user1/f1
The mkdir command is used to create a directory.
A, home/user1/this is a directory, which can be either an absolute path or a relative path.
b, if you can create multiple files in the current directory. such as: MkDir F2 F3 f4
2, RM
Format: RM-RF test/f2 test/f3
The RM command is used to delete the same as the action file.
A,-RF has r can delete the directory and its subdirectories, F is used to forcibly delete.
B, Test/f2 test/f3 is to delete multiple files at the same time.
3. pwd
Format: pwd
The PWD command is used to indicate where the current path is. is the abbreviation for print working directory.
4. cd
Format: CD.
The CD command is used to change the current directory.
A.. Represents a return to the parent directory. Represents the current directory.
B,-represents the directory that was used to go back to the previous time.
5, LS
Format: LS directory name
The LS command is used to see what subdirectories and files are in the directory.
6. CP
Format: Cp-r source directory name Destination directory name
The CP command is used to replicate the same as the action file, with R indicating that its subdirectories are copied together.
7, MV
Format: MV Source directory name destination directory name
The MV command is used to move the same as the action file, when the source directory and the destination directory are renamed under the same parent directory.
8. Find
Format: Find start directory-name The directory you are looking for
The Find command is used to find the same as the action file.

Other:

I. File/folder Management


LS lists the current directory file (excluding hidden files)
Ls-a list current directory files (including hidden files)
Ls-l list the files in the current directory for more information

Cd.. Back to the top-level directory of the current directory
CD-Back to the same directory
CD ~ or CD back to the current user's host directory
mkdir directory name Create a directory
RmDir Empty directory name Delete an empty directory
RM FileName File name Delete a file or multiple files
RM-RF non-empty directory name delete everything under a non-empty directory

MV Path/Document/warp/file movement relative to the path of the file to the absolute path
MV FileName New name renamed in current directory
Find Road via-name "string" finds paths in the range of files and directories that meet string matches such as: Find-name "Test"

Second, System management

Fdisk fdisk-l View system partition information such as: Fdisk fdisk-d: View D-Disk partitioning
Uname-a Viewing the kernel version
Cat/etc/issue View Ubuntu version
Cat/proc/cpuinfo Viewing CPU information
LSHW Viewing current hardware information
sudo fdisk-l viewing disk information
Df-h viewing the remaining space on the hard disk
Free-m View Current Memory usage
PS-A See which processes are currently in progress
Kill process Number (the number of the first column in ps-a) or killall process name (kills a process)
Kill-9 process number forces a process to be killed

three, packaging/decompression

TAR-C Create Package –x release Package-v Display command procedure –z represents a compressed package
TAR–CVF benet.tar/home/benet Pack The/home/benet directory
TAR–ZCVF BENET.TAR.GZ/MNT Package and compress the directory
TAR–ZXVF benet.tar.gz Compressed Package file decompression and recovery
TAR–JXVF benet.tar.bz2 Decompression

Iv. make compilation

Make compilation
Make install installs the compiled source package

Five, Apt command

Apt-cache Search Package
Apt-cache Show package for information about packages, such as description, size, version, etc.
sudo apt-get install package
sudo apt-get Install package--Reinstall reinstall packages
sudo apt-get-f install fix "-F =–fix-missing"
sudo apt-get Remove Package
sudo apt-get Remove Package--purge delete packages, including deletion of configuration files, etc.
sudo apt-get update source
sudo apt-get upgrade update installed packages
sudo apt-get Dist-upgrade upgrade system
sudo apt-get dselect-upgrade using Dselect upgrade
Apt-cache depends package learn about using dependencies
Apt-cache Rdepends package is to see which packages are dependent on
sudo apt-get BUILD-DEP Package Installation-related compilation environment
Apt-get Source Package Downloads The source code for the bundle
sudo apt-get clean && sudo apt-get autoclean cleanup of useless packages
sudo apt-get check to see if there is a corrupted dependency
sudo apt-get clean cleans up all software caches (that is, the Deb packets that are cached in the/var/cache/apt/archives directory)

view software XXX installation content
#dpkg-L XXX

Find software
#apt-cache Search Regular Expressions
Find out which package the file belongs to
#dpkg-s filename apt-file search filename

Query software xxx depends on which packages
#apt-cache depends xxx

Query software xxx by which packages depend
#apt-cache rdepends xxx

Add a disc source
#sudo apt-cdrom Add

System upgrade
#sudo apt-get Update
#sudo Apt-get Upgrade
#sudo Apt-get Dist-upgrade

Automatic processing of H files is missing at compile time
#sudo auto-apt run./configure

To view the temporary storage directory for downloading packages when installing software
#ls/var/cache/apt/archives

To back up a list of all packages that are currently installed on the system
#dpkg –get-selections | Grep-v deinstall > ~/somefile

Recover all packages from the list file of the installed packages backed up above
#dpkg –set-selections < ~/somefile sudo dselect

Clean up older versions of the software cache
#sudo Apt-get AutoClean

Clean up all software caches
#sudo Apt-get Clean

Remove orphaned software that is no longer used by the system
#sudo Apt-get Autoremove

View the address of the package on the server
#apt-get-qq–print-uris Install SSH | Cut-d\ '-f2

"Go" linux-ubuntu common Command Summary

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.