Movatterモバイル変換
[0]
ホーム
URL:
画像なし
夜間モード
school
文档首页
HTML
CSS
Javascript
Python
jQuery
NodeJS
PHP
Java
MySQL
Express
More »
开关
Linux 官方文档
Resource
Online
Official Website
Download
Command Line Interface Commands [.jpg]
Linux Administrator's Quick Reference [.pdf]
Linux Command Line Tips
Unix/Linux Command Cheat Sheet [.pdf]
Related
chmod
chmod Cheat Sheet
Debian
Debian Cheat Sheet
Fedora
Fedora Cheat Sheet
Red Hat
Red Hat Cheat Sheet
Ubuntu
Ubuntu Cheat Sheet
Unix
Unix Cheat Sheet
Bash Commands
Bash Commands
date
Show system date
head -n1 /etc/issue
Show distri-bution
man
command
Show manual for
command
mount
Show mounted filesy-stems
uname -a
Show system and kernel
uptime
Show uptime
whoami
Show your username
Bash Shortcuts
Bash Shortcuts
^
abc-
^-
123
Run previous command, replacing
abc
with
123
!!
Repeat last command
!*
All arguments of previous command
!
abc
Run last command starting with
abc
!
abc
:p
Print last command starting with
abc
!$
Last argument of previous command
ALT-.
Last argument of previous command
CTRL-a
Go to start of line
CTRL-c
Stop current command
CTRL-e
Go to end of line
CTRL-k
Cut to end of line
CTRL-r
Search history
CTRL-u
Cut from start of line
CTRL-z
Sleep program
Bash Variables
Bash Variables
$HOME
Home directory
$PATH
Executable search path
$SHELL
Current shell
echo
$NAME
Output value of
$NAME
variable
env
Show enviro-nment variables
export
NAME
-=
v-alue
Set
$NAME
to
value
IO Redirection
IO Redirection
cmd
Discard stdout of cmd
cmd &> file
Every output of cmd to file
cmd > file
Standard output (stdout) of cmd to file
cmd >&2
stdout to same place as stderr
cmd >> file
Append stdout to file
cmd < file
Input of cmd from file
cmd 2> file
Error output (stderr) of cmd to file
cmd 2>&1
stderr to same place as stdout
cmd1 <(cmd2
Output of cmd2 as file input to cmd1
Pipes
Anchros
cmd1 | cmd2
stdout of cmd1 to cmd2
cmd1 |& cmd2
stderr of cmd1 to cmd2
Command Lists
Command Lists
cmd1 ; cmd2
Run cmd1 then cmd2
cmd1 && cmd2
Run cmd2 if cmd1 is successful
cmd1 || cmd2
Run cmd2 if cmd1 is not successful
Directory Operations
Directory Operations
cd ..
Go up a directory
cd
dir
Change directory to
dir
ls
List files
mkdir
dir
Make directory
dir
pwd
Show current directory
ls Options
ls Options
-1
One file per line
-a
Show all (including hidden)
-l
Long listing format
-m
Comma--sep-arated output
-Q
Quoted output
-R
Recursive list
-S
Sort by file size
-t
Sort by last modified
Search Files
Search Files
find /dir/ -mmin num
Find files modifed less than num minutes ago in dir
find /dir/ -name name*
Find files starting with name in dir
find /dir/ -user name
Find files owned by name in dir
grep -i
Case insens-itive search
grep -o
Show matched part of file only
grep -r
Recursive search
grep -v
Inverted search
grep pattern files
Search for pattern in files
locate file
Find file (quick search of system index)
whereis command
Find binary / source / manual for command
File Operations
File Operations
cat file1 file2
Concat-enate files and output
cp file1 file2
Copy file1 to file2
file file1
Get type of file1
head file1
Show first 10 lines of file1
less file1
View and paginate file1
mv file1 file2
Move file1 to file2
rm file1
Delete file1
tail -f file1
Output last lines of file1 as it changes
tail file1
Show last 10 lines of file1
touch file1
Create file1
Process Management
Process Management
kill
pid
Kill process with id
pid
killall
name
Kill all processes with names beginning
name
pkill
name
Kill process with name
name
ps
Show snapshot of processes
top
Show real time processes
Nano Shortcuts
Files
Ctrl-O
Save file
Ctrl-X
Close file
Images
ALT-A
Start marking text
Navigate File
ALT-/
End of file
CTRL-_
Go to line number
Search File
ALT-W
Find next
CTRL-\
Search and replace
CTRL-W
Find
Screen Shortcuts
Screen Shortcuts
CTRL-A "
Show current instances of terminals.
CTRL-A A
Rename the current instance.
CTRL-A c
Create a new instance of terminal.
CTRL-A n
Go to the next instance of terminal.
CTRL-A p
Go to the previous instance of terminal.
screen
Start a screen session.
screen -list
Show your current screen sessions.
screen -r
Resume a screen session.
File Permissions
File Permissions
1
execute (x)
2
write (w)
4
read (r)
chmod -R 750 folder
Recursively chmod folder and contents to
rwxr-x---
chmod 644 file
Change mode of file to
rw-r--r--
chown usr:grp file
Change file owner to usr, and group to grp
Copyright©2021
w3cschool
编程狮
闽ICP备15016281号-3
闽公网安备35020302033924号
[8]
ページ先頭
©2009-2025
Movatter.jp