Should survive on Ubuntu OS (1/3)

Source: Internet
Author: User
Tags clear screen

Everything starts hard, and once you've overcome some of the first problems, you're on your way back.

Some people, like to talk a lot of theories, however, how to say, in the different stages of human learning, theoretical knowledge accounted for a different proportion.

As a basic user of Linux, or to put the practice in the first place, the theory as a tips good.


About Virtual Consoles :
6 virtual terminals, 1 graphics terminals (CTRL+ALT+F7)

SSH hostname telnet to a server
such as: SSH 10.67.40.173

Who can list currently logged in users and how they log on

When do you use the Who?
Tty1 is the first virtual terminal, we come to cat Merlin.txt
Discover Permission Denied
And then this time you want to switch the root user, is this the switch?
No, the canonical approach is to switch to the second virtual terminal, log in with the root user, and modify it on this terminal.

Command line Interface
A program that Shell Linux users use to communicate with the kernel (bash is commonly used)
All you learn here is the Bash Shell command (syntax)


The syntax rules are as follows (LS for reference)
Ls-l

Command-name command-line option (that is-) parameter

The command name is the name of the program placed under a directory (/bin or/usr/bin)

See where the command program is stored which
which PS (result is/bin/ps)
which who (/usr/bin/who) View the command PS for a process
PS Lists the processes that are started on the current terminal (you can view the PID)


PID TTY Time CMD
15859 PTS/9 00:00:00 Bash
17707 PTS/9 00:00:00 PS

The third line represents the CPU time consumed, and the fourth line represents the running process

If you want to see more detailed process information,
PS aux lists details of all processes on the current machine (PID can be viewed)

Before you look at the following command, discard the concept of the folder in window and replace it with the idea that there is only a "directory" in your mind.


view File system command LS

White file, Blue directory
LS lists the files or directories of the current directory
Ls-l listing File/directory details
Ls-al list all files/directories including hidden
ls ~ list the files in your home directory + subdirectories (~ represents your own home directory)
ls/etc/lists the files and directories under etc


View File Contents command Cat(It's best not to look at binary files)
Cat/etc/hosts
Cat-n/etc/hosts view file (plus line number, blank line is also numbered)
Cat-b/etc/hosts View files (plus line number blank lines not numbered)---(blank lines are displayed on the screen terminal, but not numbered)


For the display of special characters, there is also a corresponding expression--------first regardless
Cat-t text.txt (Convert tab blank line in text file to ^t output)


REDIRECT symbols >(Files written on the right side of the redirect should not be created in advance)
ls > Test.txt redirect the contents of the current standard output to a file (you can go to LS or check it)
Can be redirected, in addition to standard output, can also be a file
Cat-b test.txt > Test1.txt
Cal > Calendar.txt redirect journaling to calendar.txt files


Create file (timestamp of update file) touch
Touch ~/test.c

Note that the average user can only create files in their own directory
Try
Touch/etc/test.c
What happens?
Touch:cannot Touch '/etc/test.c ': Permission denied
(involves permissions, regardless of the first)

-r-t
Of course, when creating a file, you can also specify the creation time and use the creation time of other files to specify
For example
Touch-r/etc/services ~/test.c Use the creation time of the/etc/services to specify the creation time of the TEST.C
(currently meaningless, current regardless)


get help with your trial (not very detailed)--help
For example:


LS--help


See the current directory under which PWD



Other control commands:
Reset Restore terminal original look
(The terminal can display ASCII encoded files, you go to the terminal screen to open an image or binary, the screen freezes, this time input reset can be restored)
(Sometimes you don't see what you're typing, and the screen doesn't show it)



Tab key Content completion (Tab completion)


Ctrl + C interrupts the work that the user is doing (back to the prompt)
Example: Cat/dev/zero
Where the program will die (/dev/zero is a fake device), you can press CTRL + C to terminate the program

Ctrl + U Delete when moving forward

Tips: What if you lose the wrong?  For example, LS-; (originally to input ls-l)

CTRL + C and Ctrl+u are all possible.

Ctrl + L Clear Screen
Clear Clear Screen


Ctrl + Z and FG (Suspend and resume)
Sometimes the role of CTRL + Z and CTRL + C seems to want to, but I said in layman's words:
C is the terminal program, run C, the last command program died; Z is hang, first the foreground of the program to hang in the background, the goods are still alive, FG can also get it back


Example
Cat/dev/zero
CTRL + C This command program just hangs up
CTRL + Z This command is put in the background, the front desk you see the command prompt, you can enter other programs such as PWD, FG can also restore it back, and then use CTRL + C to kill it completely


Well, don't too much, hope to live on the Ubuntu12.04.5.


Speaking of comparative basis, and the layout is ugly, please gently spit groove
If you think my article to you a little help, please give me a praise, feel relatively low or where write wrong, please hurriedly, high me a sound, thank you.

Three articles per week

Merlin 2015/8/10 Night

The

should survive on Ubuntu OS (1/3)

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.