Linux Commands Cheat Sheet

A Software › Linux cheat sheet in English by xinoehp

A few commands to make it easier to browse through the logs.

11,116 views 1,660 downloads 17 Jul 2020 History

Search commands

grep -a "­search term" "File Name"
Search the file for your search term.
grep -a "­search term" "File Name" -A3
Search for the search time and view 3 lines after.
grep -a "­search term" "File Name" -B7
Search for the search time and view 7 lines before.
grep -a "­search term" "File Name" -C2
Search for the search time and view 2 lines before and after.
grep -a "­search term" *
Search all files in the current folder for your search term.
tail -100 "File Name"
List the last 100 lines of the file.
tail -F "File Name"
List the lines in the log as they are written.
head -50 "File Name"
List the first 100 lines of the file.
cat "File Name"
List all lines, oldest to newest in the file.
tac "File Name"
List all lines, newest to oldest in the file.
gt "­device IMEI"
Search today's GT300 log for the IMEI

Navigation through folders

ls
List files in the current folder.
pwd
Show the current folder name.
"­folder name"
Enter the folder (if you can see the folder with "­ls")
cd ..
Go up a folder.
cd
Go all the way up to the main folder.

Other Shortcuts

Ctrl+C
Stop the current command (if there's an issue, try this).
Ctrl+I­nsert
Copy selected text.
Shift+­Insert
Paste copied text.
Tab
Attempt to finish the current command being typed.

Badges

Nice Cheat Sheet

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.