Linux Learning Notes-basic operations 1

Source: Internet
Author: User

1>. Command parser
2>. Linux shortcut keys
3>. Linux System directory Structure
4>. User Directory
5>. File and directory Operations
6>. Properties of files and directories
7>. File permissions, users, user groups
8>. File Lookup and retrieval
9>. Installation and uninstallation of software
10>. USB Stick mount and unload


1. Command parser:
Shell-Unix Operating system
Bash--Linux operating system
Essence: invokes the corresponding executable program according to the name of the command
2. Linux shortcut keys
1>. Command and path completion: TAB Double-click to see some commands or directories have been complete
2>. Main keyboard shortcuts:
1). History Command Toggle:
Historical command: History
Traverse up: Ctrl+p
Traverse down: Ctrl + N
2). Cursor Movement:
Left: Ctrl+b
Right: Ctrl+f
Move to head: Ctrl + A
Move to Tail: ctrl+e
3). Delete characters:
Delete the character behind the cursor: Ctrl+d = = DEL
Delete the character that precedes the cursor: ctrl+h = = Backspace
Delete all the contents before the cursor: ctrl+u
4). Clear screen: Ctrl+l = = Clear
3. Linux SYSTEM directory structure:
1>. Root directory:
2>. /bin:bin is the abbreviation for binary, which holds commands that are often used.
3>. /dev:dev is a device abbreviation that stores Linux external devices and accesses the device in Linux in the same way that it accesses files.
4>. /etc: This directory is used to store all the configuration files and subdirectories required for system administration.
5>. /home: The user's main directory, in Linux, each user has a directory of their own, generally the directory name is named after the user's account.
6>. /lib: This directory contains the system's most basic dynamic connection shared library, which acts like a DLL file in Windows. These shared libraries are required for almost all applications.
7>. /media:linux system will automatically identify some devices, such as USB flash drive, optical drive, etc., when identified, Linux will attach the identified device to this directory.
8>. /MNT: The system provides this directory for users to temporarily mount other file systems, we can mount the CD-ROM drive on the/mnt/, and then enter the directory to view the contents of the CD-ROM.
9>. /root: This directory is a user home directory for system administrators, also known as super-permissions.
10>. /usr: This is a very important directory, the user's many applications and files are placed in this directory, similar to the Program Files directory under Windows.
11>. /OPT: This is the directory where additional installation software for the host is placed. For example, if you install an Oracle database, you can put it in this directory. The default is empty.
12>./sbin:s is the meaning of super user, which is stored in the system administrator's use of the hypervisor.
13>./var: This directory is stocked with things that are constantly expanding, and we are accustomed to placing directories that are often modified in this directory. Includes various log files.
14>./lost+found: This directory is generally empty, and when the system shuts down illegally, some files are stored here.
4. User directory:
1>. Absolute path: Start writing/home/itcast/aa from the root directory
2>. Relative path: BB phase for the current working directory
. Current directory
.. Current top-level directory
---Directly switch CDs in the adjacent two directories-
3>. [Email protected]:~$
Itcast: currently logged in user
@: At In
Ubuntu: Host Name
~: User's home directory (host directory)
$: Current user is a regular user
#: Super User--root
5. File and directory operations
1>. View my assets (table of contents)
1). Tree-The software must be installed
2). Ls-la View more information
2>. Wandering between a lover and an ex-wife:
CD Lover Directory
Cd
Home to appease wife and children: (Three ways to go home)
Cd/home/aaa
CD ~
Cd
View my current wife, ex-wife, or lover's bed:
Pwd
3>. Buy a house for a lover (Create a directory)
One cottage: mkdir dirName
Set of villas: mkdir dir/dir1/dir2-p (Parameters for multi-level catalogs)
4>. Sell an ex-wife's house while his ex is away: Delete empty directory rmdir lover
5>. Buy a jade bracelet for his wife: Touch Lucy (if the file exists, modify the time)
6>. Confiscation of all the property of a lover:
Villa: Delete directory: Rm-ri bb (ri indicates recursive hint delete)
Jewellery: Deleting files: RM stdio.h
7>. To furnish a wife with the same property as a lover: Copy file: CP hello.c Temp (careful file overwrite)
Copy directory: CP mytest/newdir-r (-R indicates recursion.) Directory if it exists, place the directory in the directory)
8>. Wife View the contents of the list (5 ways):
1.cat file name
2.more file name (enter to view next line, space to view next page, Q or CTRL + C exit)
3.less file name (enter to view the next line, space to view the next page, you can combine keys to view forward.) Q or CTRL + C exit)
4.head file name (first 10 lines, parameters-5 can see 5 lines)
5.tail file name (after 10 lines, parameter-5 can see 5 lines)
9>. The wife used the black technology, everywhere can quickly come to my side (shortcut): Soft Link: ln-s filename shortcut name (cannot be used after the move)
10>. My wife made a backup of my property: Hard link: The name of the ln filename shortcut (can be used after moving) (map, do not occupy file space, number of hard links plus one, modify one to modify, delete a hard link number minus one, can not be created for the directory)
6. File or directory attributes: (Understanding content, non-focus)
1>. WC text File information: Number of lines, number of words (subject to space), number of bytes, file name
2>. Od-tx binary file information: view content
3>. Du-h the size of a file or directory under a pro directory
4>. Df-h Use of disks
which command name (view the path where the command is located)
7. File permissions, users, user groups
1>. View current logged in User: WhoAmI
2>. Modify file Permissions:
1). Text Setting Method: chmod [who] [+|-|=] [mode]
Who
File owner: U
File belongs to group: g
Other people: O
All the people: a
+: Add Permissions:
-: Reduce permissions
=: Overwrite the original permission
Mode
R: Read
W: Write
X: Execute
2). Digital Setting Method:
-: No Permissions
R:4
W:2
X:1
765
7--rwx--File owner
6--rw--Files belong to group
5--RX--Others
-: Minus permissions-001 Other people do not have permission to execute
3>. To change the owner or owning group of a file or directory: Chown new owner [: New Filegroup] File name (you can use sudo to temporarily borrow root privileges)
4>. To change the group to which a file or directory belongs: chgrp a new Filegroup file name (you can use sudo to temporarily borrow root privileges)
8. Find and Retrieve
1>. Find by file properties:
1). File name: Find + Find directory +-name + "file name" (in quotes, wildcard * Any number of characters,?) one character)
2). File Size: Find + Find directory +-size + +10k (greater than 10k, must be lowercase k, uppercase M)
3). File type: Find + Find directory +-type + d/f/b/c/s/p/l (Directory/normal file/block device/character device/socket/pipe/link symbol)
2>. Search by File content:
Grep-r "What to find" + path to find
9. Installation and uninstallation of the software
1>. Online Installation: Installation: sudo apt-get install tree-Online download and installation
Removal: sudo apt-get remove tree
2>. Deb Package Installation: Installation: sudo dpkg-i xxx.deb
Removal: sudo dpkg-r xxx
3>. SOURCE Installation:
Case: Installing SVN
A../configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR
B. Make
C. sudo make install
USB Stick mount and unload
1>. Mount: System default mount directory:/media
Manual mount directory:/mnt:
View device name: sudo fdisk-l
Mount Mode: Mount + device name + mount directory (/MNT)
2>. Uninstall: sudo umount/media/itcast/esd-usb
sudo umount/mnt (when unloaded, the user's current position must not be/mnt (/media) or its subdirectories, or it cannot be uninstalled)
3>. Mount to a directory other than/mnt--when the mount succeeds, it will obscure the original contents of the directory, and the original data in the directory can be seen after uninstalling the device.

Linux Learning Notes-basic operations 1

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.