Basic commands for the Linux Foundation

Source: Internet
Author: User

First, Linux basic commands and how to get help

Format of the 1.Linux command

Command + options = parameter

A) command: Tell the Linux (UNIX) operating system what to do (execute).
b) Option: Describes how the command runs (you can change the function of the command). The options section starts with a "-" character.
c) Parameters: Describes what the command affects (action) (such as a file, a directory, or a paragraph of text)

2. Functions of each command

Who: Displays all users who are currently logged on, as well as the current date and time.

Date: Displays the current day and time of the system. The format of the modification time is: Date month day year

SU: Switches from the current user to another specified user.

For example: The command to the root user: Su-root

passwd: Modify the user's password

Man: Get instructions for using a Linux command.

Command name--help: Get Help

Second, the Linux directory

Some of the important directories in 1.linux

"/" means the root directory

. Represents the working directory where the user resides

.. Previous level directory of current directory

Bin directory: Used to store common executable files

Sbin Directory: The executable file used to store the system

Home directory: Used to store the user's own files or directories, where Superuser Root's home directory is/root, while the normal user's home directory is stored in the/home directory, and the user name is the last level directory (family directory) name, such as the SAM user's home directory is/home/sam

Dev directory: Device files directory

ETC Directory: Configuration file directory

mount point (directory): Removable hardware gray-backed mount under the/media or/mnt directory

2. Absolute and relative paths

Absolute path:/start, full path to the file location, anywhere you can find the desired file using the absolute path.

Relative path: Not in/start, relative paths can contain the names of each directory that must traverse from the current target to the object (directory or file) you are looking for.

Iii. commands used to browse, manage, and maintain catalogs

PWD: Determine the working directory where you are now

CD: Toggle the current directory

Cd.. : Go to the top level directory

CD ~: Switch to the user's home directory

CD-: Fantasy to User's previous working directory

CD directory name: Switch to the specified directory

LS: Lists the contents of the current directory or the specified directory

Ls-a: Lists all files under the directory, including "." The implied file at the beginning

Ls-all: With Ls-a

Ls-l: List details of each file in a directory

CP: Copies a file (which can be multiple) into a specified destination file or into a specified target directory.

Cp-r: A recursive secondary directory. When copying a directory, copy all of the contents of the directory, including the entire contents of the subdirectory.

Cp-f (Force, mandatory): Do not ask for direct force replication when the destination file already exists.

MV: You can move files and directories between different directories, or you can rename files and directories.

mkdir: Create a new directory.

Touch: Create an empty file

RM: Permanently delete files or directories from the file system.

RM-RF: Forcibly deleting a directory or file and does not ask

Basic commands for the Linux Foundation

Related Article

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.