Ubuntu Learning 1

Source: Internet
Author: User
Tags create directory locale

Linux directory structure:

/: All directories are in
/boot:boot configuration files, kernels, and other files required for startup
/etc: Storing files related to system configuration
/home: Store Normal User Directory
/MNT: Manually mounted file system on hard disk
/media: Automatic mounting (loading) of hard disk partitions and removable media like CDs, digital cameras, etc.
/cdrom: Mount the disc?
/OPT: To store some optional programs, such as a program test version, installed to the directory of all the data of the program, the library files are present in the same directory
/root: The system administrator's directory, for the system, the system administrator is like God, he can do anything to the system, such as deleting your files, generally do not use the root user.
/bin: Store frequently used program Files (command files).
/sbin: System administration commands, which are stored in the hypervisor used by the system administrator
/tmp: temporary directory, storing temporary files, the system will periodically clean up the files in this directory.
/usr: In this directory, you can find additional tools that are not suitable for use in/bin or/etc directories. such as games, printing tools and so on. The/usr directory contains many subdirectories: The/usr/bin directory is used for storing programs, and/usr/share is used to store some shared data, such as music files or icons, etc./usr/lib directories are used to store those that cannot be run directly, However, it is a function library file that is necessary for many programs to run. /usr/local: This directory is generally used to store the user's self-compiled installation software storage directory, usually through the source package installed software, if not specifically designated installation directory, is generally installed in this directory.
/usr/bin/Non-essential executables (not required in single-user mode), for all users.
The/usr/include/standard contains files.
/usr/lib/libraries for binaries in/usr/bin/and/usr/sbin/.
/usr/sbin/non-essential system binaries, such as: The daemon of a large number of network services.
/usr/share/Architecture-Independent (shared) data.
/usr/src/source code, for example: Kernel source code and its header file.
/usr/x11r6/x Window System version one, release 6.
/usr/local/the third level of local data, specifically to the host computer. In general, there are further subdirectories, such as: bin/, lib/, share/.

/var: This directory contains files that are frequently modified, including various logs and data files;
The/var/cache/application caches data. This data is a time-consuming I/O or calculation result that is generated locally. The application must be able to regenerate or restore data. Cached files can be deleted without causing data loss.
/var/lib/status information. Persistent data maintained by the program at run time. For example: database, packaged system metadata, and so on.
/var/lock/lock file, a class of files that track resources currently in use.
The/var/log/log file contains a large number of log files.
/var/mail/the user's e-mail address.
/var/run/information about the system that is running since the last boot, for example: the currently logged on user and the running daemon. [13] has now been replaced by/run.
/var/spool/Offline files for tasks that are waiting to be processed, such as: print queues and unread messages.
/var/spool/mail/the user's mailbox (an discouraged storage location)
/var/tmp/temporary files that can be retained during system restart.
/lib: The directory is the shared library required by the program on the root file system, which holds the shared files required for the root file system program to run. These files contain code that can be shared by many programs to prevent each program from having a copy of the same subroutine, making the executable smaller and space-saving.
/lib32: Ibid.
/lib64: Ibid.
/lost+found: The directory is empty in most cases. However, when a sudden power outage, or abnormal shutdown, some files are temporarily stored;
/dev: Store device files
/run: Instead of the/var/run directory,
/proc: Virtual file system, you can obtain system information in this directory, the information is generated in memory by the system itself, the contents of the directory is not on the hard disk and in memory;
/sys: Like proc, a virtual file system can obtain system information in this directory, which is generated in memory by the system itself, and the contents of the directory are not on the hard disk and in memory;

The role of the swap partition:

When the system's physical memory is not sufficient, it is necessary to release some of the space in physical memory for use by the currently running program. The freed space may come from programs that have not been manipulated for a long time, and the freed space is temporarily saved in the swap space until those programs run, recovering the saved data from the swap into memory. In this way, the system always does swap swap when physical memory is not enough.

sudo cat/proc/sys/vm/swappiness

The default value for this value is 60.

Swappiness=0 indicates the maximum use of physical memory, then the swap space,

SWAPPINESS=100 indicates active use of the swap partition, and the memory data is moved into the swap space in a timely manner.

--Temporary modification:

[Email protected] ~]# sysctl vm.swappiness=10

Vm.swappiness = 10

[Email protected] ~]# cat/proc/sys/vm/swappiness

10

Here our changes are in effect, but if we restart the system, it will become 60.

--Permanent modification:

Add the following parameters to the/etc/sysctl.conf file:

vm.swappiness=10

Language environment

See if Chinese support is installed

Locale-a

If there is a Zh_cn.utf8, the system already has a Chinese locale installed, and if not, you need to install the appropriate package. The installation method is as follows:

sudo apt-get install Language-pack-zh-hans language-pack-zh-hans-base

..............................................

Software Management apt (Advanced packaging Tool), he can automatically download, configure, install software packages, simplify the Linux system. Both the Debian and the derivative versions contain apt, and the Redhat series of Linux is managed using Yum, where DNF is used to replace Yum in Fedora22 Centos7.

apt-Cache Search Package Search packages apt-Cache Show Package get information about packages, such as description, size, version, etc. sudo apt-get install package sudo apt-get install package–reinstall Reinstall package sudo apt-get-F Install force installation sudo apt-Get Remove package Remove packages sudo apt-Get Remove Package–purge removes the package, including removing the configuration files such as sudo apt-get autoremove automatically delete unwanted packages sudo apt-Get update updates source sudo apt-get upgrade update installed packages sudo apt-get dist-upgrade upgrade system sudo apt-get dselect-upgrade using Dselect to upgrade apt-Cache depends package understands the use of dependent apt-the Cache Rdepends package understands a specific dependency on sudo apt-get build-DEP Package Installation-related compilation environment apt-get source package to download the source code for the bundle sudo apt-get Clean && sudo apt-get autoclean Cleanup download file for archive sudo apt-get Check to see if there is a corrupted dependency

APT's configuration file:

/etc/apt/sources.list Provisioning package Get source /etc/apt/apt.conf apt profile /etc/apt/apt.conf.d Apt's fragmented configuration file /etc/apt/Preferences version parameter /var/cache/apt/archives/partial holds the package being downloaded /var/cache/apt/  Archives Store the downloaded package/var/lib/apt/lists store the downloaded package details/var/lib/apt/lists/partial Store the package details that are being downloaded

Software source configuration file format:

Deb Http://security.ubuntu.com/ubuntu xenial-Security main restricted#  deb-src/http Security.ubuntu.com/ubuntu xenial-security main restricteddeb Http://security.ubuntu.com/ubuntu xenial-  Security Universe#  deb-src http://security.ubuntu.com/ubuntu xenial-security UniverseDeb http ://security.ubuntu.com/ubuntu xenial-Security multiverse#  deb-src http://security.ubuntu.com /ubuntu xenial-security Multiverse

The Ubuntu software warehouse is divided into four parts: main (primary), restricted (limited), universe (Broad), multiverse (plural), which is mainly based on our ability to support the software and whether the purpose of the software conforms to our free software philosophy.

Let's look at a section of the configuration file:

The first Deb represents the package format, either Deb or DEB-SRC, which indicates that the binary format (compiled) is pointed to, and the latter is the sources format (the original code).
The second URI, the Universal Resource Identifier, is the generic resource identifier, which can be located at the beginning of a package with several parameters: file (System), CDROM (optical drive), HTTP, FTP, copy, rsh, SSH, and so on.
The third distribution refers to the release version number, which can be: Stable,testing,unstable,sarge,etch,sid, etc., refer to the Debian document specifically.
Some of the following component represent specific package classifications:

Main: Fully follow the Debian free software code, the DFSG package;
Contrib: Software packages follow the DFSG free use principle, but they use some third-party libraries that do not conform to DFSG;
Non-free: A package that does not conform to DFSG.

Dpkg is the foundation of the Debian Package Manager and is used to install, unload, and supply information related to. deb packages. Dpkg itself is a low-level tool that itself cannot download packages from the remote package repository and handle the dependencies of the package, and the package needs to be downloaded from the remote and then installed. Dpkg Common commands:

Dpkg--------C Package.deb lists the contents of the Deb package dpkg– Configure package Configuration Packages

Date: Dates and times used to display or set the system

Date//Show Current Date#date Formatting#%Y Year#%m Month (01..12)#%d day of month (e.g.)#%H Hour (00..23)#%I Hour (01..12)#%M minute (00..59)#%s second (00..60)Date +"%y%m%d%h%m%s"223856Date+"%y-%m-%d%h:%m:%s"2016-08-24 22:39:07Date-S//set the current time, only root privileges can be set, others can only be viewed. Date-S 20061010//set to 20061010, this will set the specific time to empty 00:00:00Date-S 12:23:23//set a specific time and do not make changes to dates date-S "12:12:23 2006-10-10″//This allows you to set the full time#NOTE: After you reset the time, you need to poke the time out of the hardware clock. Here's how:Hwclock-w

Cal: Show a calendar

Cal  #   Reality Calendar of the current month cal-y  #  Displays calendar of the year #  # Displays the calendar for the specified year 

Setting the time zone

Tzselect # or

Change Password:

# command to change password # default modification of the current user's password  #  Modify the password for the specified user and require administrator privileges

Forgot password

Start by pressing the SHIFT key, go to the Grub menu--enter edit mode by letter E--edit content-boot into but user mode, reset user password,--> follow F10 Restart-> enter system with new password


Logoff/restart/shutdown

Logout # Logout

Reboot # Reboot system: Need a new administrator

Shutdown # Shutdown: Requires Administrator privileges

# Reboot now shutdown-r +5  #  three minutes after restart Shutdown-r 12:12 # Restart the     computer at 12:12  #  now shut down immediately shutdown-h +5  "The System will shutdown after 3 minutes"   # c14> prompts the user to shut down the machine after three minutes shutdown-h +5   #  5 minutes after shutdown shutdown-h   12 o'clock Shutdown shutdown-c   #  Cancel shutdown Operation

CD: Switch directories

CD  #  back to the current user's home directory #  ~  can be used to represent user home directory CD  #  switch to/etc directory   #  switch to the previous directory

PWD: View the current work path

To create a directory:

# mkdir Directory Name mkdir My_dir # -P parameter: recursively create directory for simultaneous creation of multi-level catalogs mkdir   a/b/c/d   

Get help

-H--help Info man

Man man  #  view man  command manual man   cd  man 5   # fuzzy Find man-f  passwd  # Exact Search

Create a file

Touch: Changes the time of the file or directory and creates an empty file when the file does not exist.

# created when File1 is not present # do not create file touch-r ref_file file1  update file1.txt timestamp andref+-t 201210120505.25 file1# -   T  time uses the value specified as a new value for the corresponding time stamp of the specified file. The # time here is defined as the decimal number in the following      form:#  [[cc]yy]mmddhhmm[]. SS]     #    here, CC is the first two digits of the number of years, that is, "century"; yy is the last two digits of the number of years, that is, the number of years in a century. If the value of CC is not given, touch   will limit the number of years Ccyy to 1969--2068. MM for the number of months, DD for the day will be the number of years Ccyy limited to 1969--2068 within. MM is the number of months, DD is the number of days, HH is the number of hours (several), MM is the number of minutes, SS is the number of seconds. The set range of seconds here is 0--61, which can handle leap seconds. These numbers consist of a time in the time zone specified by the environment variable TZ. Due to system limitations, the time earlier than January 1, 1970 was wrong. 

Note: If the file starts with ".", it means that the file is a hidden file.

Delete:
RM: Delete command

Rm-f  #  Force Delete file rm-r  a/b/file1  #  Delete the specified directory and all files and directories under it RM-RF  a/b/ File1  #   Force deletion of the specified directory and all files and directories under it #  RM command too dangerous, not recommended

MV: Move or re-command files or directories

MV SOURCE DEST  #mv Test.log test.txt  #  file renamed MV Test1.txt dir1/      # move files mv test1.txt  test2.tx  test3.tx dir1/      # move multiple files 

CP: Copy

# Copying Files   -i SOURCE DEST  # prompt cp-r dir1 dir2 if it    encounters a condition that needs to be overwritten   if the given source file is a directory file, the CP will recursively replicate all subdirectories and files in that directory. The destination file must be a directory name cp-p  file1 file2  #   At this point, the CP will also copy its modification time and access rights to the new file, in addition to the contents of the source file.   -rp dir1  Dir2

Stat: View File trust information

#   Access Time (atime): Refers to the timing of the use of files, the so-called access, common operations are: using the editor to view the contents of the file, using the Cat command to display the contents of the file, using the CP command to copy the file (that is, the source file) to other files, Or in this file, use the grep sed more less tail head and other commands, usually read without modifying the file operation, balanced change the file's access  time. #   Modify Time (mtime): Refers to the change in the content of the file, as long as the contents of the file changes (such as the use of the switch to the output or to attach the way) or the operation of the file, it will change the Modify of the files, usually when we use Ls–l to view the file, The time shown is  modifytime#  Change Times (CTime): refers to when file attributes or file location changes, such as using Chmod,chown, The MV instruction set uses LN to make the file's obstinately connection, which changes the file's change time.

Cat: Link files after the output file content to the screen, in fact, to view the contents of the file

TAC: The output of the anti-career

Cat file1  # show file1 file contents cat file1 file2   #cat-n file1  #   number of rows starting at 1 for all outputs cat-s file  #  When you encounter a blank line that is more than 2 rows in a row, leave only one line blank

Ubuntu Learning 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.