Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ 10 useful Linux command line tips     - Installation Eduspec university management systems 17 Linux Mint (Server)

- Linux system Perl Lite netstat (Linux)

- Use the vi text editor and copy and paste Linux tips (Linux)

- Run two MySQL service on one server (Database)

- Java static internal class (Programming)

- Based on Google Cloud Storage Mirroring open Maven Central Repository (Server)

- The Linux firewall is configured to use proxy (Linux)

- Use GNU / Linux broadcasting of television programs (Linux)

- grep search from files and display the file name (Linux)

- Log device files under Linux - logger (Linux)

- To compiler and install MariaDB-10.0.20 under CentOS 6.6 (Database)

- How common Linux automation tasks (Server)

- To install Python-Pip and Fabric under CentOS / Ubuntu (Linux)

- Linux operating system security management skills (Linux)

- Usage Linux device tree (Programming)

- You really do need to know a variety of programming languages (Programming)

- Linux shell script debugging (Linux)

- Linux SVN installation and configuration graphic tutorials (Server)

- KVM virtualization of nested virtualization (Linux)

- Oracle Data Guard LOG_ARCHIVE_DEST_n optional attribute parameters (Database)

  10 useful Linux command line tips
  Add Date : 2018-11-21      
  I remember the first time I use Linux, I also used Windows graphical interface, I really hate Linux terminal. At that time I think the command is difficult to remember, you can not use them correctly. Over time, I realized that the beautiful, flexible and availability Linux terminal, to be honest, I do not have a day without using it. Today, I am very happy and just getting started with Linux people together to share some useful tips and hints, hoping to help them better transition to Linux, and help them to learn something new (hopefully).

10 Linux command line tips

5 interesting Linux command line tips
Management Linux file types five useful commands
This article hopes to show you some does not require high technology can be used in the same master as a helpful tips Linux terminal. You only need a Linux terminal and some free time to appreciate these commands.

1. Locate the correct command

Execute the correct command for your system is very important. However, there are so many, it is difficult to remember a variety of command line in Linux. So how do you find the right commands you need it? The answer is apropos. You only need to run:

# Apropos
Where you want to use really describe what you want to find a command statement instead of "description". Here is an example:

# Apropos "list directory"
dir (1) -list directory contents
ls (1) -list directory contents
ntfsls (8) -list directory contents on an NTFS filesystem
vdir (1) -list directory contents
On the left you can see is the command, the right is their description.

2. Run previous command

Many times over and over again you need to execute the same command. Although you can press the up cursor keys on your keyboard, but you can also use an alternative command history. This command lists since the last time you had to start all the input terminal command:

# History
2apt-get install gnome-paint
3hostname tecmint.com
4hostnamectl tecmint.com
6hostnamectl - set-hostname tecmint.com
7hostnamectl-set-hostname tecmint.com
8hostnamectlset-hostname tecmint.com
9mount-t "ntfs" -o
11mount-t ntfs-3g / dev / sda5 / mnt
12mount-t rw ntfs-3g / dev / sda5 / mnt
13mount-t -rw ntfs-3g / dev / sda5 / mnt
14mount-t ntfs-3g / dev / sda5 / mnt
17mount-t -o ntfs-3g / dev / sda5 / mnt
18mount-o ntfs-3g / dev / sda5 / mnt
19mount-ro ntfs-3g / dev / sda5 / mnt
20cd / mnt
As you can see above, you'll get a list of commands that you have run. Each row has a number that you enter in the first few lines of command. You can re-invoke the command the following methods:

! #
The actual number of which command to use instead of #. To better understand, look at the following example:

! 501
Equivalent to:

# History
3. Use the command midnight

If you are not accustomed to using similar cd, cp, mv, rm commands, you can use the command midnight. It is a simple visualization shell, you can use the mouse in the above:

Midnight command

With the F1 to F12 keys, you can easily perform different tasks. Only need to select the corresponding command at the bottom. To select a file or directory, press the "Insert" key.

Briefly midnight is called "mc". To install mc, just run:

$ Sudoapt-get install mc [OnDebian based systems]
#yum install mc [OnFedora based systems]
Here is a simple example of the use of midnight commander. Open mc by entering the following command:

# Mc
Now use the TAB key to select a different window - left and right. I want to move to a "Software" directory LibreOffice files:

Midnight command to move files

Press the F6 button to move the file a new directory. MC will ask you to confirm:

Move the file to a new directory

After confirmation, the file will be moved to the new destination directory.

Further reading: How to Use Midnight command file manager in Linux

4. Turn off the computer at a specified time

Sometimes you need to work a few hours and then turn off the computer. You can turn off your computer at a specified time by using the following command:

$ Sudoshutdown21: 00
This will tell you in your designated time to shut down the computer. You can also tell the system to shut down after a specified minutes:

$ Sudoshutdown + 15
This means that the computer will shut down after 15 minutes.

5. The user's information is known

You can use a simple command to list the users of your Linux system and some basic information about them.

# Lslogins
This will output the following results:

0 root 00Apr29 / 11: 35 root
1 bin 01 bin
2 daemon 01 daemon
3 adm 01 adm
6shutdown01Jul19 / 10: 04shutdown
8 mail 01 mail
10 uucp 01 uucp
12 games 01 games
13 gopher 01 gopher
14 ftp 01 FTP User
23 squid 01
25 named 01Named
27 mysql 01MySQLServer
47 mailnull 01
48 apache 01Apache

6. Find File

Find files sometimes are not as simple as you think. A good example of a search for files is:

# Find / home / user -type f
This command will search for all files / home / user directory. find command is really powerful, you can pass it to give more options to make your search more detailed. If you want to search for files over a certain size, you can use:

# Find.-type f -size10M
The above command will search the current directory of all the files larger than 10M. Make sure not to run the command in the root directory of your Linux system, because it may cause your machine I / O bottlenecks.

One option I most often find command together with the "exec", which allows you to find the results of the command to run some operations.

For example, if we want to find all the files in a directory and change the permissions. You can complete the following simple command:

# Find / home / user / files / -type f -execchmod644 {} \;
- ApacheDS configuration of users and user groups to achieve SSO (Server)
- Linux network monitoring strategy (Linux)
- Redis-- persistence articles (Database)
- Linux system using the command line shutdown or restart (Linux)
- Copy and paste in Linux terminal and Vim (Linux)
- 10 useful Linux command line tips (Linux)
- CentOS 6.5 installation and configuration Cobbler (Server)
- MySQL composite partition (Database)
- CentOS installation Docker series (Linux)
- Upgrading to MySQL 5.7.9 MySQL 5.6.23 (Database)
- Oracle metadata Reconstruction experiments (Database)
- Linux kernel to achieve soft RPS network to receive soft interrupt load balancing to distribute (Linux)
- Kitematic how seamless and DockerFILE (Server)
- Common data structures and functions of Linux process scheduling (Programming)
- Linux disk management practices (Linux)
- RedHat yum configuration and the prompt (Linux)
- Configuring automatic mail GAMIT under CentOS system (Linux)
- Create a custom pixel format based on an existing image data BufferedImage (Programming)
- Linux 10 useful examples of command-line completion (Linux)
- Encrypted with GnuPG signature to verify the authenticity and integrity of downloaded file (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.