20165318 preparatory work 3 Linux installation and learning

Source: Internet
Author: User
Tags parent directory

Linux installation and learning one, VirtualBox and Ubuntu installation

I installed VirtualBox 5.2.6 and Ubuntu 16.04 LTS, and the installation process followed the steps in the teacher's blog, following several questions.
Q: There is no Ubuntu (64-bit) in the options when creating a virtual machine and selecting the version of the virtual machine system.

A: After the Internet query found that the need for the CPU to allow hardware virtualization, the need to enter the BIOS, select the configuration of the Intel Uirtual technology, the disabled changed to Enabled after saving.

Q: During the allocation of shared data space, because the command has no output, after the setup is complete, the files in the discovery directory cannot be shared.

A: After careful examination of my command and Lou's command, I found that the "sudo mount-t vboxsf rocshare/mnt/shared" did not change rocshare to my own shared file. After discovering the problem, I executed the correct command again and finally achieved the purpose of sharing.

Harvest

This is my first time on the computer to install the system, the beginning of the feeling will be difficult, but in accordance with the teacher's tutorial step by step, there are problems to try to solve their own, and learn from the students in the blue ink cloud class questions, the final completion of virtual machine and system installation. I did not know about the virtual machine at first, just according to the tutorial step-by complete, the input of the command is not aware of what is the use, after studying in the experimental building, I am curious about the new operating methods of Linux, but also learned some basic commands.

Second, Linux command learning

The command format for Linux is:
command [options] [arguments] //中括号代表是可选的,即有些命令不需要选项也不需要参数
where 选项 (option) is a switch that adjusts the execution behavior of a command, different options dictate that the command is displayed differently, 参数 (arugment) refers to the object that the command is acting on.

Shortcut keys

Ctrl+Alt+T: Open terminal.
Ctrl+Alt+F1~F7: Switch terminal.
Ctrl+Shift+T: Creates a new tab page.
Ctrl+C: Interrupts the program.
Ctrl+d: keyboard input end or output terminal.
Ctrl+s: Pause the current program and press any key to resume operation.
Ctrl+z: Puts the current program in the background.
fg: Background Run program resumes foreground.
Ctrl+a: The cursor moves to the input wardrobe, equivalent to Home .
Ctrl+e: The cursor moves to the end of the input line, equivalent to End .
Ctrl+k: Delete from the cursor position to the end of the line.
Alt+Backspace: Deletes a word forward.
Shift+PgUp: Scrolls the terminal display up.
Shift+PgDn: Scrolls the terminal display down.
Alt+数字+N: Jumps tab page.
Tab: Complete terminal command, also used in C language programming.
上键: Toggles the history command.

Wildcard characters

*: matches 0 or more characters.
: matches any one character.
[list]: matches any single character in the list, separated by commas.
[!list]: Matches a character other than any single character in the list! The following should be enclosed in parentheses (), separated by commas.
[c1-c2]: matches any single character in the C1-C2.
{string1,string2,...}: Match string1 or string2 or ... One of the strings in the.
{c1..c2}: matches all characters.

User

who: View users.
Related parameters:
-a: Prints all that can be printed.
-d: Prints the dead process.
-m: Same as AM I,mom likes.
-q: Prints the number of currently logged on users and the user name.
-u: Prints the login information for the currently logged in user.
-r: Print run level.

sudo: Executes the command at the privilege level (root permission).
sudo adduser 用户名: Create a new user.
su: Switch User.
exit: Exit user or terminal, same as Ctrl+d .
groups: View user groups, or view /etc/group files.
usermod: Adds a user group to the user, which can be used to sudo usermod -G sudo 用户名 add users to the sudo user group.
deluser: Delete a user.

File operations

ls: You can view the file's permissions, size, file name, and so on with different parameters.
Related parameters:
-A: Displays except. (current directory) and. (Top level directory), including hidden files (under Linux). The file that starts with is a hidden file).
-Al: View the full properties of a directory.
-dl:< directory name;: Displays all file sizes.
-AsSh: Where small S is the size of the display file, big S is sorted by file size and can be used by man to know how to sort by other means.

chown: Change the file owner sudo chown <新所有者> <文件名> .
chmod: Change file permissions
Binary numbers indicate: chmod 数字 文件名 .
Add and subtract assignment operations: g , and o also u represent group, others, and user, respectively, + and - add and subtract corresponding permission examples: chmod go-rw 文件名 .

touch: Create a file.
cp: Copy files, cp 文件名 路径 .
rm: Delete, parameter -f can force delete parameter.
mv: Move file: mv 源目录文件 目的目录 , rename file: mv 旧的文件名 新的文件名 .
rename: Batch rename.
cat: Positive sequence display print file contents to standard output (terminal), plus -n parameter display line number
tac: Reverse print file contents to standard output (terminal)
nl: Add line number and print, cat -n more professional line number Print command
more, less : Paged view.
head, tail : View the first few lines of the file (the default is 10 lines, the full is displayed in less than 10 lines), and the tail lines.
file: View file types.

Directory

cd: Enter a directory.
pwd: Gets the absolute path.
.: Current directory.
..: Parent directory.
-: The last directory in which it was located.
~: Home for the current user.
mkdir: Create a directory.
cp: Add parameter R or r to copy the specified directory cp 文件名 路径 .
rm: Add parameter R or r to delete the specified directory.

File Search

whereis: Simple and fast, querying directly from the database, only binary (-B), man help (-M), and source (-s) files.
locate: Fast and full, manually executes the updatedb command once to update its lookup object-the "/var/lib/mlocate/mlocate.db" database, which can be used to find different file types under the specified directory.
which: Small and fine, usually using which to determine if a specified software is installed, because it only searches for commands from the path specified by the PATH environment variable
find: Fine and thin, it can be found not only by file type, file name, but also based on the properties of the file (such as the file's timestamp, file permissions, etc.) to search. The first argument to find is where to search: The basic command format is find [path] [option] [action] , for example: sudo find /etc/ -name 文件或目录 .

    • Time-related command parameters:
      -atime: Last Access time
      -ctime: Last time the file content was modified
      -mtime: Last time the file properties were modified
    • Number of days commands associated with these parameters (example with-mtime parameter)
      -mtime n: N is a number, expressed as a modified file "within one day" before N days
      -mtime +n: Lists files that have been modified before n days (not including the N-day itself)
      -mtime -n: Lists files that have been modified within n days (including the N-day itself)
      -newer file: File is an existing document, listing the new file name
File packaging and compression

du: View the size of the file and compress the compression level of the file.
zip: Compress packaged files.
Related parameters:
-r: Indicates that the recursive package contains the entire contents of the subdirectory.
-q: expressed as quiet mode.
-o: Represents the output file, which needs to be followed by the package output filename.
-O: You can specify the encoding type Unzip-o GBK Chinese compressed file. zip.

unzip: Unzip the zip file.
tar: Packaged but not compressed (without parameters).
Related parameters:
-cPackaging
-x: Unpack the package.
-f: Answer file name.
-z: Compress with gzip tool.
-J: Compress with XZ tool.
-j: Compress with bzip2 tool.

Variable

declare: Creates a variable and = assigns a value to the variable.
$: The value of the reference variable.
set: Prints all variables of the current Shell.
env: Prints the current user-related environment variables, and allows the command to run in the specified environment with a range smaller than set.
export: Prints a variable that is exported to an environment variable, and can also export the custom variable to an environment variable range that is smaller than Env.
PATH=$PATH:用户名: Add a custom path (be sure to use an absolute path) to the "path" environment variable.
>>: Indicates that standard output is redirected to a file in Append mode.
>: Is redirected to a file in the overridden manner.
unset: Deletes a variable.
source: Make the environment variable effective immediately.

Disk

df: View the capacity of the disk and -h enhance readability with parameters.
du: View the capacity of the directory.
Related parameters:
-d: Specifies the depth of the view directory.
-a: The same--all displays the size of all files in the directory.
-s: Only the totals are displayed with--summarize, and only the last plus total value is listed.

dd: Convert and copy files, or you can read files or write to these files. The format is: 选项=值 . Options if and of can change the standard input and output.
mkfs: Format the disk.
mount: Mount the disk.
unmount: Unmount the disk.
fdisk: Partition the disk.

Help

help: Displays a brief help message for the built-in command. Parameters can be used for external commands --help .
man: Displays help information in the manual.
info: More detailed GNU information than the Man command.
cheat: "Small copy", which succinctly provides explanations and examples that are easier to understand than man, but need to be installed.

20165318 preparatory work 3 Linux installation and learning

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.