Your SlideShare is downloading. ×
0
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Some Tricks in Using Terminal - KienDT

841

Published on

This is some tricks in using terminal that improve your speed and give you more convenient with command line

This is some tricks in using terminal that improve your speed and give you more convenient with command line

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
841
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. SOME TRICKS IN USINGTERMINALTrung Kien Do
  • 2. AGENDAFind anything with “grep”Quick command with “alias”Commands combination with “|”Suggest commands with “apropos”Some other useful commands1.2.3.4.5.
  • 3. WHY NOT USE FINDERtime waste in searching what’s inside filenot search the hidden filenot flexible: result all contain either “TMX” or “Map” whensearch exactly “TMX Map”limited by searching by keywords only••••
  • 4. FIND ANYTHING WITHGREPgrep options pattern file...some useful options••Text in Subfolder -r grep -r “TMX Map” .Find any file in sub folder of current folderWhole words only -w grep -w “Map”Find Map only, not mapping, maps, mappedCase-insensitive text -i grep -i “map”Return all Map, MAP, map, ....File name only -l grep -l “TMX Map”Find all file contain TMX Map, but return filename onlyNumber of occurrencesonly-c grep -c “TMX Map”Return all file and number of hits TMX Map in each fileSearch using regular expression•
  • 5. QUICK COMMAND WITHALIASsometimes type something like this is like ****mysql -uroot -prvm_reload_flag=1 source /Users/kien_metalrock/.rvm/scripts/rvmwine ~/.wine/drive_c/Program Files/Oxford/Oxford CollocationsDictionary/ocoll2e.exe......and many so long with complex options commands•
  • 6. QUICK COMMAND WITHALIASMake command become shorter and readablealias mysql= mysql -uroot -p alias rvm_restart= rvm_reload_flag=1 source/Users/kien_metalrock/.rvm/scripts/rvmalias oxford= wine ~/.wine/drive_c/ProgramFiles/Oxford/Oxford Collocations Dictionary/ocoll2e.exe••••
  • 7. COMMAND COMBINATIONWITH PIPE (|)The output of command before will be input of aftercommandExamples:grep -r "TMX Map" . | grep "Objects"history | grep "git"history | awk {print $2} | sort | uniq -c | sort -rn | head•••••
  • 8. SUGGEST COMMAND WITHAPROPOSsometimes you want to do something but don’t rememberexactly what command should be used?apropos keywordExamples:apropos gitapropos patternapropos disk space••••••
  • 9. SOME OTHER USEFULCOMMANDSln make linkscd - back to before folderw show who are logged on and what they are doinglast the last users logged inhistory show all command in historywhich,whereiswhere does the command come fromdf -h, du -h disk usage statisticssplit & cat split & concat file
  • 10. THANK YOU FOR YOURLISTENING !

×