Home Operation and Maintenance Linux Operation and Maintenance Common commands and shortcuts in Linux systems

Common commands and shortcuts in Linux systems

Jun 18, 2023 am 08:46 AM
shortcut key Command Line terminal

With the widespread application of the Linux operating system, more and more people begin to need to learn and understand the basic commands and shortcuts in the Linux system. In this article, we will introduce some commonly used Linux commands and shortcuts to help beginners understand the Linux system and improve work efficiency.

  1. Commonly used commands

1.1 ls command

The ls command is one of the most commonly used commands in Linux. It is mainly used to list files and subdirectories in the current directory. Commonly used options are:

-l: Display file information in long format, including file type, file permissions, owner, group, file size, creation date, file name, etc.

-a: Display all files, including hidden files.

-h: Display file size in human-readable format.

Example: ls -lha /home/user/

1.2 cd command

The cd command is used to switch the current working directory. When a user logs into the system, the default current working directory is the user's home directory. Commonly used options are:

..: Switch to the upper directory.

-: Return to the previous working directory.

Example: cd /var/www/html/

1.3 mkdir command

The mkdir command is used to create an empty directory. Commonly used options are:

-p: Create multi-level directories recursively.

Example: mkdir -p /home/user/test/

1.4 cp command

The cp command is used to copy files or directories. Commonly used options are:

-r: Copy the directory and its subdirectories and files.

-p: Keep the properties of the source file, including permissions, timestamps, etc.

Example: cp -rp /var/www/html /home/user/

1.5 mv command

The mv command is used to move or rename files or directories. Commonly used options are:

-f: Do not ask, force overwriting of existing target files.

-i: Ask, if the target file already exists, prompt whether to overwrite it.

Example: mv /var/www/html /var/www/backup/

1.6 rm command

The rm command is used to delete files or directories. Commonly used options are:

-r: Recursively delete the directory and its subdirectories and files.

-f: No confirmation operation is performed.

Example: rm -rf /var/www/html/

  1. Shortcut

2.1 Tab completion

Tab completion All are very commonly used shortcuts in the Linux command line. When the user enters a command or path, pressing the Tab key can automatically complete the files or commands in the current directory, saving operation time and reducing manual input errors.

2.2 Ctrl C and Ctrl Z

Ctrl C shortcut key is used to terminate the current command, which can help users quickly exit wrong commands or operations.

Ctrl Z shortcut key is used to pause the current command, put it into the background for execution, and return to the command line prompt. Can be used to suspend, resume and manage background processes.

2.3 Ctrl D and Ctrl T

Ctrl D shortcut key is used to indicate the end of input and can be used to confirm the current input or the end of the file.

Ctrl T shortcut key is used to exchange the characters at the cursor position, which can be used to quickly adjust the character position in the command or path.

Conclusion

This article introduces the commonly used commands and shortcuts in Linux systems. Although these commands and shortcut keys may seem simple, for beginners, accumulating and mastering this knowledge is an important step in establishing a good Linux foundation. I hope this article can help readers better understand Linux systems and improve their productivity and efficiency.

The above is the detailed content of Common commands and shortcuts in Linux systems. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Keyboard shortcut for quickly merging cells in Word Keyboard shortcut for quickly merging cells in Word Feb 18, 2024 pm 12:08 PM

Word shortcut keys for merging cells When editing tables using Microsoft Word, we often need to merge cells in order to adjust the structure and layout of the table. Word provides several ways to merge cells, including using shortcut keys. This article will introduce the shortcut keys for merging cells in Word to help you operate tables more efficiently. In Word, you can use shortcut keys to merge cells. The following are some commonly used shortcut keys for merging cells: Ctrl+Shift+

How to solve the problem that the NVIDIA graphics card screen recording shortcut key cannot be used? How to solve the problem that the NVIDIA graphics card screen recording shortcut key cannot be used? Mar 13, 2024 pm 03:52 PM

NVIDIA graphics cards have their own screen recording function. Users can directly use shortcut keys to record the desktop or game screen. However, some users reported that the shortcut keys cannot be used. So what is going on? Now, let this site give users a detailed introduction to the problem of the N-card screen recording shortcut key not responding. Analysis of the problem of NVIDIA screen recording shortcut key not responding Method 1, automatic recording 1. Automatic recording and instant replay mode. Players can regard it as automatic recording mode. First, open NVIDIA GeForce Experience. 2. After calling out the software menu with the Alt+Z key, click the Open button under Instant Replay to start recording, or use the Alt+Shift+F10 shortcut key to start recording.

What should I do if the Ubuntu terminal cannot be opened? How to fix the problem that Ubuntu cannot open the terminal What should I do if the Ubuntu terminal cannot be opened? How to fix the problem that Ubuntu cannot open the terminal Feb 29, 2024 pm 05:30 PM

It is a very common problem these days that Ubuntu does not allow its users to open the terminal. If you receive a similar issue and don’t know what to do next, learn about five fixes on how to resolve this “Ubuntu cannot open terminal” issue on your Linux device. Without further ado, let’s dive into what causes it and the solutions available to it. Why can't Ubuntu open the terminal on it? This mainly happens when you install some defective software or modify the terminal configuration. In addition to this, new applications or games that interact with locales and corrupt them can cause similar problems. Some users reported a fix for this issue when searching for Terminal in Ubuntu's activity menu. This shows that

How to use shortcut keys to take screenshots in Win8? How to use shortcut keys to take screenshots in Win8? Mar 28, 2024 am 08:33 AM

How to use shortcut keys to take screenshots in Win8? In our daily use of computers, we often need to take screenshots of the content on the screen. For users of Windows 8 system, taking screenshots through shortcut keys is a convenient and efficient operation method. In this article, we will introduce several commonly used shortcut keys to take screenshots in Windows 8 system to help you take screenshots more quickly. The first method is to use the "Win key + PrintScreen key" key combination to perform full

What is the shortcut key to shut down the computer? What is the shortcut key to shut down the computer? What is the shortcut key to shut down the computer? What is the shortcut key to shut down the computer? Feb 22, 2024 pm 02:34 PM

The shutdown shortcut key for Windows desktop computers is ALT+F4; the shutdown shortcut key for Windows laptops is Alt+Fn+F4; the shutdown shortcut key for Apple computers is Ctrl+Option+Power key. Analysis 1 If it is a Windows desktop computer, the shortcut key for shutting down is ALT+F4. After pressing the key, the shutdown interface will pop up. Simply press the Enter key to complete the shutdown. 2. If it is a Windows laptop, the shortcut key to shut down is Alt+Fn+F4, and then press the Enter key to complete the shutdown. 3. If it is an Apple computer, then the shutdown key is Ctrl+Option+Power key to complete the shutdown. Supplement: What are the computer shortcut keys? 1 The computer shortcut keys are: C

Upgrade Ubuntu 20.04 to 22.04 via command line Upgrade Ubuntu 20.04 to 22.04 via command line Mar 20, 2024 pm 01:25 PM

This article details the steps to upgrade Ubuntu 20.04 to 22.04. For users using Ubuntu 20.04, they have missed the new features and advantages brought by version 22.04. In order to get a better experience and security, it is recommended to upgrade to a newer Ubuntu version in time. Ubuntu22.04 is codenamed "Jamie Jellyfish", let's explore how to get the latest LTS version! How to upgrade Ubuntu 20.04 to 22.04 via the command line Mastering the command line will give you an advantage. While it is possible to update Ubuntu via the GUI, our focus will be via the command line. First, let’s check the currently running version of Ubuntu using the following command: $

Learn to copy and paste quickly Learn to copy and paste quickly Feb 18, 2024 pm 03:25 PM

How to use the copy-paste shortcut keys Copy-paste is an operation we often encounter when using computers every day. In order to improve work efficiency, it is very important to master the copy and paste shortcut keys. This article will introduce some commonly used copy and paste shortcut keys to help readers perform copy and paste operations more conveniently. Copy shortcut key: Ctrl+CCtrl+C is the shortcut key for copying. By holding down the Ctrl key and then pressing the C key, you can copy the selected text, files, pictures, etc. to the clipboard. To use this shortcut key,

What is the shortcut key for renaming? What is the shortcut key for renaming? What is the shortcut key for renaming? What is the shortcut key for renaming? Feb 22, 2024 pm 02:50 PM

The shortcut key for renaming is F2. Analysis 1 The shortcut key for renaming is F2. 2 If you want to rename a file or folder, you can press F2 after selecting the file, modify it directly and press Enter. 3 Sometimes you can also use the mouse to select the file, right-click, select Rename, and press Enter after the modification is completed. 4 Shortcut keys refer to the special combination or sequence of keys on the keyboard to quickly complete a certain command, which can effectively improve work efficiency. Supplement: What are shortcut keys? 1 Shortcut keys, also called hot keys, refer to completing an operation through certain specific keys, key sequences or key combinations. You can use shortcut keys to do some work instead of the mouse. You can use keyboard shortcuts to open, close, and navigate the start menu, desktop, menus, and dialog boxes.

See all articles