Linux common commands (files, directories, processes, permissions)

Source: Internet
Author: User
Tags bz2 echo command set time


Linux Delete Folder command
Linux Delete directory is very simple, many people are still accustomed to using rmdir, but once the directory is not empty, into deep distress, now use the RM-RF command.
Direct RM is OK, but add two parameters-rf namely: RM-RF directory Name
-R is recursive down, no matter how many levels of directory, delete
-F is simply forced to delete, without any hint of the meaning

Linux Find files and folders command

Find File path

Find/-name httpd.conf lookup file

Find-name conf Find folder

Catalog renaming

Under Linux, moving files and renaming are the same command, MV (which is the meaning of move)

Command: MV Source filename Destination file name

1. Rename the/home/wwwroot/sinozzz123/index.htm to/home/wwwroot/sinozzz123/index.html

# mv/home/wwwroot/sinozzz123/index.htm/home/wwwroot/sinozzz123/index.html

2. Rename the/home/wwwroot/sinozzz123 directory to/home/wwwroot/sinozzz456

# mv/home/wwwroot/sinozzz123/home/wwwroot/sinozzz456

Linux Decompression Compressed File command

. tar.bz2
Decompression: Tar jxvf FileName.tar.bz2
Compression: Tar jcvf FileName.tar.bz2 dirname

Linux View System version number
Cat/etc/issue
Uname-a

Linux Install VM virtual machine

Official Download Address: http://www.vmware.com/products/player/
Installation commands
Bash/yourpath/vmware-player-3.1.1-282343.i386.bundle

Linux displays the full path to the current directory
PWD command, which displays the entire path name.

Linux View hidden files
Ls-a

Linux Find Files
Find-name

Linux View process commands
Ps-e

Linux shutdown Process Command
Kill-15 +pid

Linux Permissions
sudo chmod 777-r *

echo command

The function of the echo command is to display a piece of text on the monitor, which generally acts as a hint.

The general format for this command is: Echo [-n] String

where option n means that the output text does not wrap, and the string can be enclosed in quotes or without quotes. Output a quoted string with the Echo command, outputting the string as it is, and using the echo command to output a string without quotes, each word in the string is output as a string, separated by a space between the strings.

Cal Command

The function of the CAL command is to display a calendar for the month of the year.

The general format for this command is that the options in the CAL [Options] [month [year]] command have the following meanings:

-J shows that each day of the given month is the first days of the year (starting from January 1).

-y Displays the calendar for the whole year.

Date command

The function of the date command is to display and set the system date and time.

The general format for this command is: date [options] Displays the time format (beginning with +, followed by formatting)

Date set time format

The meanings of the options in the command are:

-D datestr,--date DATESTR displays the date described by datestr

-S Datestr,--set datestr set datestr description of the date

-U,--universal Show or set Universal Time

Time Domain

% H hours (00. 23)

% I-hour (01. 12)

% K hours (0. 23)

% l hour (1. 12)

% M minute (00. 59)

% p displays am or PM

% R Time (Hh:mm:ss am or PM), 12 hours

% s number of seconds from January 1, 1970 00:00:00 to current experience

% S sec (00. 59)

% T Time (24-hour system) (HH:MM:SS)

% X shows the format of the time (%h:%m:%s)

% Z time zone Date field

% a weekday abbreviation (Sun.. Sat)

% A week's full name (Sunday). Saturday)

The abbreviation of the% B-month. DEC)

The full name of the% B-month (January). December)

% c date and time (Mon Nov 8 14:12:46 CST 1999)

% d One months of the first day (01. 31)

% D Date (MM/DD/YY)

% h and%b options are the same

% J The first day of the year (001. 366)

% m month (01. 12)

% W one week of the first day (0 for Sunday)

% W The first few weeks of the year (00. 53, Monday for the first day)

% x shows the format of the date (MM/DD/YY)

The last two digits of the Y-year (1999 is 99)

% Y year (for example: 1970,1996 etc.)

Note: Only Superuser has permission to set the time using the Date command, and the average user can only display the time using the date command.

Clear command

The function of the clear command is to purge information on the screen, similar to the CLS command in DOS. When the screen is cleared, the prompt moves to the upper-left corner of the screen.

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.