Category: Linux

Linux cp and SCP Commands

Name: cpUsage: All usersSyntax: cp [options] source destcp [options] source… directoryDescription: Copy one file to another, or copy several files to another directory. The -a option preserves as much of the file status, permissions, and other data as possible …

How to Clear Linux Cache

Today I used Spotlight to check the memory usage on the development server, and only 60MB was left. You can use the following method to clear the cache. Frequent file access can cause a significant increase in system Cache usage.
First, use free -m to check the remaining memory[root@Oracle ~]# free – …

20 Essential Linux System Monitoring Tools Every Admin Needs

Need to monitor Linux server system performance? Try these built-in or bundled tools below. Most Linux distributions come equipped with a wealth of monitoring tools. These tools provide metrics that can be used to obtain relevant information and system activity. You can use these tools …

Linux user Command

useradd
1. Purpose
The useradd command is used to create user accounts and create the user’s home directory, with superuser privileges required.
2. Format
useradd [-d home] [-s shell] [-c comment] [-m [-k template]] [-f inactive] [-e expire] [-p passwd] [-r] nam …

httpd: Unrecognized Service Fix

Install Apache as a System Service

# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

Then vi /etc/rc.d/init.d/httpd add (below #!/bin/sh)

# chkconfig: 2345 50 90

# description: Activates/Deact …

How to View Logs in Linux

1. cat Command: Function: 1) Display an entire file. Example: $ cat fileName 2) Concatenate files and send to standard output, such as merging several files into one or outputting to the screen. Example: $ cat file1 file …

How to SSH Into Your Machine Using Python

Time to write some Python code. I love automating things, and today I’ll show you how to use Python to connect to your machine via SSH and run commands on it. It’s not difficult, but doing it with Python isn’t exactly trivial either, because it requires quite a few modules and libraries to accomplish this task. 你是 …

How to Recursively Set Directory and File Permissions in Linux

The chmod command can change permissions for all subdirectories. Below are 2 methods
Changing permissions for a single file: chmod mode file|dir
Changing permissions for all subdirectories: chmod mode dir -R Note the -R parameter added at the end. The parameter is the permission mode mode = 777 or 752 , 666,,, mod …

Glances: The Adaptive All-in-One System Monitoring Tool

Very few command-line tools can adapt to different terminal sizes to provide users with the maximum amount of information. Most tools display similarly——either the information becomes garbled or the tool throws an error message. However, Glances is one that supports everything from an 80×24 terminal to any …