Linux Command - command system application
1, Time Management
date: display system time
clock: display hardware time
hwclock -W: to synchronize the system time to hardware time
hwclock -s: the hardware time synchronized to the system time
cal: the calendar display
Modification date:
Time set to command 1996 January 9 as follows:
#date -s 1/9/2009
Set Date and Time: August 2008 12:00 No. 8
DATE -s "2008-08-08 12: 00:00 "
to set the time to 14:36 pm.
date -s 14:36:00
End time remember to change the bios time synchronization:
synchronization BIOS clock to force the system time to write CMOS, the following command:
#clock -w
2, Help command
internal command help: help COMMAND
external command help: man cOMMAND
command Manual: Manual
whatis the cOMMAND: this command displays the section in which the help of man.
================================================== ==========
man operation command:
blank: turn back a screen
b: flip ahead a screen
ENTER: turn back row
k: turn forward line
========= ================================================== =
keyword search
/ kEYWORD: Find keyword backwards
? KEYWORK: forward lookup key
n: the next key position
N: before a keyword
q: quit man help
3, system information,
change directory
cd back to the user's home directory
cd ~ username: Enter the specified user's home directory
cd - : a directory in the current directory where the front and back and forth switching
CD ..: switch to the parent directory
cd / home enter '/ home' directory '
. 4, ALISE
defined alias command shell
alias the cOMMAND = CMDALIAS
the unalias CMDALIAS is a de-alias command
5, printenv
displays the current variable information
6, whoami
displays the current user who is
su -: When switching shows that user before switching
7, who
view the current system login user and his terminal logged on
-r: Displays the current run level
-H: The first list shows each column name back
w: who is more detailed than the information display
8, last
login on the current system log (/ var / log / wtmp file), including the system users and restart the information
last -n numbers: only show recent logins
9, lastb
displays the user's login errors common sense
lastb -n numbers: show only recent errors login information
10, lastlog
displays information for each user last successful login
lastlog -u USERNAME: display a specified user's most recent login information
11, basename
display a directory of group names
basename / etc / abc / me directly show Me
$ 0: command path name or the script itself.
basename $ 0: directly call the script itself path
12, mail
message view, you can view the message, it will put in the user's home directory mbox file folder to view later.
-s theme
mail -s "How are you" root
CAT / etc / the FAST | mail -s "How are you" root
13, hostname
hostname: Displays the name of the current host
hostname Host Name: host name change
14, fuser
verification files or sockets in use
-v: view the process on a file in use
-k: the process is available to kill the
-km: the process on the mount points are closed off
15, watch
periodically execute a specified command, and display results in full screen
format: Watch -n # 'the COMMAND'
-n #: specified period, in seconds, 2 seconds default
16, ps
View Process
BSD-style common options:
A: Show all terminals and related processes? : That associated with a terminal
x: displays all processes associated with a terminal
u: displays information
aux: a combination of
SysV style popular options:
-elf: View all the information (e: all processes)
-elf: No F Detailed
-o PROPERTY : specified attribute display
17, top
dynamic display process information
support interaction, which command
M: sorted according to the size of the memory-resident
P: The percentage of CPU used to sort
T: sorting based on the accumulated time
l: whether the average load and start time
t: if the display CPU status information and related
m: whether to display memory-related information
c: whether to display the full command line information
q: quit Top
k: terminate a process
commonly used options:
-d 1: a few seconds to refresh
-b: batch mode display
-n #: in batch mode, display total number of approved
18, the foreground and background
foreground job: a command prompt occupies
background job: After starting, the command prompt release, subsequent operations done in the background
foreground -> Background:
Ctrl key + Z: is the background to the foreground job
bg : let's stop the job continues to run background
bg [% JOBID]:% can save
fg: foreground job will be sent to the background
fg [% JOBID]:% SysV style can save common options:
-elf: View all the information (e: all processes)
-elf: no F detailed
-o pROPERTY: Specifies the attribute display
19, the shutdown
the shutdown [-akrhHPfnc] [-t secs] Time [warning the Message]
the shutdown: shutdown command
-r now: immediately restart
-t sec: After a few seconds
-h now: immediate shutdown
20, uname
uname -r: Check the system kernel version
uname -a: System Version Information
21, dd
conversion and copy files, copying the data stream is the bottom of
the format: dd if = data source data storage destination of = bs = # much as one unit count = # copy
such data several times
e.g.
dd if = / dev / sda of = / mnt / usb / mbr.backup bs = 512 count = 1
can be used to backup MBR
create loop file
dd if = / dev / zero of = / var / swapfile bs = 1M count = 1024 this command can create a 1G size image file, and the image file and can be directly mkswap it is possible to start
/ dev / zero is bubble devices, zero could have been spit out
22, mktemp
mktemp: create a temporary file
file mktemp /tmp/file.XX(XX represents the system automatically generated) generates temporary file
mktemp -d /tmp/file.xx: generating a temporary directory
23, AT
AT: Specifies the future point in time to perform a certain task
Time Format
Absolute time: HH: MM DD: MM: YY MM / DD / YY
relative time: now + # (minutes, hours , days, weeks)
blur time: Noon, Midnight, Teatime
AT the -l: show their list of jobs
at -d job number: deletes the job
24-, cron
cron: allow uninterrupted service
system cron-defined format:
minute hour day week month user tasks
the user cron job definition format
definition file / var / spool / cron / USERNAME
format: minute hour day week month mission