Common shell commands for Linux

Source: Internet
Author: User

Some common shell commands in Linux

For many programmers who often program in XP, it is not a habit to suddenly switch to programming in Linux, because a lot of things that can be done with the mouse in XP before, now we use commands to complete the process (although many Linux operating systems now support mouse operations, but since we have learned Linux, I personally think we usually use shell commands, the reason is that. I think everyone will understand)

 

For your convenience, I have summarized some of the most common commands in Linux. Some other commands can be used in the future. We do not need to remember all these commands (and I do not think that is necessary ).

I. Common shell commands:

1. CD tiger indicates entering the tiger directory
2. ls to view files in the current directory
A. ls tiger-l only displays the details of Tiger
B. ls tiger-Al print out all the types used by the file.
Drwxr-XR-x 3 Root 4096 2010-08-02
[Attribute] [connection] [owner] [user group] [file size] [modification date] [file name]
The preceding and... indicate the current directory and the upper-level directory respectively.
C. ls-A: Show Hidden Files (all files starting with a point are hidden files)
. Bash_history. GnuPG. Themes
. Bash_logout. gstreamer-0.10. thumbnails
. Bashrc. GTK-bookmarks. Update-notifier
. Bogofilter. gvfs. Vim
. Cache. iceauthority. viminfo
D. ls-s are arranged in the file size

E ls-I displays the index number of the file.

F.
Ls-N allows you to view the ID of the file owner and the file group.

G.

Ls-l can view the last time the file was repaired

3. CD... indicates to exit under the main directory.
4. mkdir tiger indicates creating a tiger directory
5. Touch tiger indicates creating a tiger File
6. rmdir tiger indicates deleting an empty directory.
7 RM tiger indicates deleting an object
8 Alt + Shift + T indicates opening a new console in one console
9 Alt + Shift + N indicates a new console interface
10. rm-r tiger indicates deleting a non-empty directory (r indicates recursive deletion)
You can also use Rm-fr tiger to forcibly delete a non-empty directory)
11. sudo apt-Get install installation command
12. ls-l module. h only displays module. h
13. Run CD/var/log to enter the log file directory.
14 CD/var/log/
CAT/var/log/syslog View System Log Files
15 tar zxvf tiger.tar.gz to decompress the file
Tar xvjf is used to decompress tar.gz.bz2 t
Tar xvzf used to decompress tar.gz
11. view the previous input command: History
12 copy and paste
CP tiger. C ../work (put tiger. c In the work file under the parent directory)
CP tiger./work-R (put the directory tiger in work under the current directory)

13. Find a file or directory

Find-name filename: Find the file or directory of a filename.

Eg: Find-name tiger. c search for tiger. C in the current directory

Tiger-John note:


1> is to add the parameter-R (-r indicates recursion) to the directory)
2> put it in the current directory as./If it is a parent directory, then ../
13. The music video is a clipboard (the same as above)
MV tiger. C ../work (put tiger. c In the work file under the parent directory)
MV tiger. C./work-R (put the directory tiger in work under the current directory)
14. Use Su to switch to the root directory
15. CD/enter the root directory
16. Cd ~ Go to main directory

 

Tiger-John note:

Some shell commands have many suffixes, for example, ls commands have many suffixes, and some people ask, how can we remember them?

In fact, I'm very calm to tell you not to remember. You only need to enter the command: Man shell command on the terminal to see the detailed usage of all its suffixes.

For example, Run man ls to view the detailed usage of the Suffix in LS.

So the man command is very powerful.


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.