Linux common commands and frequently asked Questions <------> First Chapter

Source: Internet
Author: User

View all hidden directories below the file:
Ls-al ~
Ls-al ~
Ls-a-L ~
You can see that the results of the three command execution are consistent because the LS is a space-delimited argument for the arguments following the command, and no matter how many spaces the shell will be considered as one.

2. Under Linux, the two files of Vbird and Vbird are "exactly the same" files. So when you do it, be careful whether the command is uppercase or lowercase. For example, the following
Face these commands to see what the problem is:
Date <== results show datetime
Date <== results show command not found
DATE <== results show command not found
Not the same case, some will display the wrong information. So please remember this.

3. Language
Many times you will find that when you enter a command, the result is garbled?
1> Displays the languages currently supported
Echo $LANG
#上面的意思是说, the current language (Lang) is Utf-8
2> can also modify the language
Lang=en_us
Echo $LANG

4. Basic command operation
Shows the date and practice of the command: date;
Displays the date of month: Date +%y/%m/%d
commands for displaying calendars: cal; (List this month's monthly calendar, directly execute the CAL)
Show calendar for a year: Cal, Col 2017
Easy to use calculator: BC.

5. Hotkey: Tab CTRL + C CTRL+B
TAB: Command completion
CTRL + C: terminating programs
Ctrl+d: Keyboard input end meaning, can replace the input of exit.

6. Viewing of error messages
[[email protected]/]# DATE
-bash:date:command not found
The base table above is the name of the shell, the error means that the command can not be found, it is possible that the system does not have the date of the command, usually appear command not found possible
The reasons are:
1> This command does not exist because the software is not installed, the workaround is to install the software.
2> the directory in which the command is located does not include the current user in the command search path
3>. Command input Error

7.Linux system's online Help man page with info page

8. Super Simple text editor: Nano
Linux also drink a lot of text editor exists, our most commonly used is the VI, in fact, there are quite a very good text editor exists, here first say nano text editor.
Nano is easy to use you can open an old file or a new file by simply adding the file name.
Nano Test.txt Test.txt There is no relationship, if present, will open the old file, if not present will open the new file
After you enter the Nano, there are a lot of command instructions.
CTRL +g: Get online Help Group
Ctrl +x: Leave the Naon software, if you have modified the file, you will be prompted to save
CTRL +o: Save the file, if you have permission, you can save the file
CTRL +r: Reading from other files
CTRL +W: Query string
CTRL +C: Describes the number of rows and columns information at the cursor location
CTRL +_: You can enter the line number directly, so that the cursor directly to the row
ALT +y: Correction syntax
Alt +m: The ability to support the mouse to move the cursor

9. Correct shutdown method
Ps-aux View programs running in the background
Netstat-a view the online status of the network
who view who is currently online
Customary shutdown command: Shutdown
Restart shutdown: Reboot halt Poweroff
Shutdown-h now shuts down
Shutdown-h 20:25 eight o'clock 25 min shutdown
shutdown-h +10 over 10 minutes shutdown
Shutdown -R Now restarts
Shutdown-r +30 ' The system will reboot ' again in 30 minutes, and displays the following message to the user who is online
shutdown-k the "This" and "this" wil L reboot ' warning will not shut down
10. Restart, shutdown: Reboot halt Poweroff

11. Troubleshooting during boot
1 File system error
If the root directory is not damaged, assuming that you have the wrong partition in/dev/sda7, then at boot time, the screen should sue you, press root password or ctrl+d
This time enter the root password login system, and then do the following:
Enter the root account password login system, for single-user maintenance work
Input FASCK/DEV/SDA7 (fsck for file system Check command,/DEV/SDA7 for the wrong partition , please execute the parameters according to your own situation, if there is a hotline any problem is that the screen will appear clear "y/n"
Direct input y)
after repair, restart the

with reboot

12. Forgot root Password solution
Forget the root password do not need to reinstall, as long as the single user maintenance mode login can change your root account password, first restart the system at the time of reading the second press any key and then press E into the Grub edit mode
At this point, move the cursor to kernel which line, at the click of E to enter kernel the editing interface in China, the last side of the KKERNL input such as single press ENTER will use the command passwd change the new password
You will be prompted to enter a new password two times. Finally, you can change the root password with reboot.

Linux common commands and frequently asked Questions <------> First Chapter

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.