Cheatography
https://cheatography.com
about Red Hat Certified Engineer 8 module
This is a draft cheat sheet. It is a work in progress and is not finished yet.
File & Document Manage
echo -n -e |
use in shell script |
date +"%F %H:%M:%S |
show date and time |
cat > >> file |
Place or Add input into file |
touch file |
Create or Update File |
ls -la/ld |
Display all information about files/Directories |
mkdir -p directory-name |
Create directory by |
rm -rf file/directory |
Forcefully remoce file/Directory |
rmdir |
Delete empty directory |
cp file1 file2 localpath |
copy file1&file2 to path |
cp/mv file1 file2 |
copy/mv file to file2 |
cp -r dir1 dir2 |
copy dir1 to dir2,create dir2 if it doesn't exist |
head tail more less file |
Output contents of file |
tail -f file |
Output contents of file as it grows starting with the last 10 lines;usual use in check for logs |
>;>>;<;<<;&>;&>> |
input & output redirect |
[];*;'';\ |
match a single character in a range;Matches any number of characters;make char diable the meaning. |
|;|grep |
pipe ,on the left command output & right get the output into input |
find path -name/size name/+100000K |
find files by name or gt 100M |
grep;egrep pay file ;-e/i/v/n |
Search for pay in files;command options |
xargs |
Excute command lines from standard input. |
vim edit
hjkl |
turn left/up/down/right |
gg |
go to head of line |
G |
go to last line |
nG |
go to N line |
x |
delete letter of the cursor |
X |
delete letter left of the cursor |
u |
undo;initializing when hold on it |
dd |
delete the line of the cursor;ndd:delete the n line under the cursor(includle the line of sursor) |
yy |
copy the line of the cursor,nyy similar ndd |
P/p |
add the content of "dd/yy" above/under the cursor |
i/I |
insert on the left/head of the line |
a/A |
insert on the right/the end of the line |
o/O |
add the new line under/above line of sursor |
:wq/w/q/q!/wq!;:set nu/nonu |
module of the end line;save&quit/save/quit/force save&quit/display line numer;undo display the line number |
/content |
search content of the file;n search next;N search previous |
:n1,n2s/oldcontent/newcontent/golbal |
replace content;:1,$s/oldcontent/newcontent/g |
|
|
|
|
|