Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

How to display a list of recent commands in Ubuntu Linux Kaip matyti iš naujausių komandos Ubuntu Linux sąrašą

Linux has a rich command line experience that can sometimes be a little daunting for people switching over from Windows. Linux daug komandų eilutę patirtis rodo, kad kartais gali būti šiek tiek bauginanti žmonėms persijungti iš "Windows". Displaying the list of recent commands is pretty simple, though: Parodyta pastarųjų komandų sąrašas yra gana paprasta, jei:

> history > Istorija

1 ps -ef 1 ps-ef
2 kill 24188 2 žudyti 24.188
3 ps -ef 3 ps-ef
4 tail logfile.log 4 uodega logfile.log

If you want to find a command that you used before but you have a huge history list, you can quickly find it by passing it through grep. Jeigu norite surasti komandą, kurią naudojote anksčiau, bet turite daug istorijos sąrašą, galite greitai rasti, perduoti ją per grep. Let's say we remember typing the ftp command, but can't remember the domain name of the server: Tarkime, mes prisimename, spausdinimo FTP, bet negaliu prisiminti domeno vardas serveryje:

> history | grep ftp > Istorija | grep ftp

321 ftp 321 FTP ftp.cdrom18.com ftp.cdrom18.com

Pretty simple stuff! Gana paprasta stuff! What if we want to display the list of items that we use the most often?  We can use a much more complicated command like this: Ką daryti, jei norime parodyti sąrašą dalykų, kad mes naudojame dažniausiai? Mes galime panaudoti daug sudėtingų komandą panašus į šį:

> history|awk '{print $2}'|awk 'BEGIN {FS=”|”} {print $1}'|sort|uniq -c|sort -r > Istorija | awk '(print $ 2)' | awk 'BEGIN (FS ="|"} (print $ 1)' | sort | uniq-c | sort-r

114 ls 114 Lt
105 ./runreports.sh 105. / Runreports.sh
97 cd 97 CD
24 uptime 24 uptime
15 mysql 15 MySQL
13 vi 13 VI

The last command was thanks to Paskutinis komanda buvo dėka Lifehacker Lifehacker , which is a great site you should definitely subscribe to. , Kuri yra puiki svetainė jums būtinai užsisakyti.

The techniques used in the last command are useful in other contexts. Technologijas, naudojamas paskutinis komanda yra naudingas kitais atvejais. I'll be posting more similar commands going forwards. I'll be parašėte daugiau panašių komandų vyksta į priekį.

This article was originally written on 10/4/06 Tagged with: Šis straipsnis buvo parašytas ant 10/4/06 Tagged with: SysAdmin Sysadmin , , Ubuntu Ubuntu

Daily Email Updates Dienos paštas Atnaujinimai

You can get our how-to articles in your inbox each day for free. Galite gauti mūsų kaip prie straipsnių į Jūsų pašto dėžutę kasdien nemokamai. Just enter your name and email below: Tiesiog įveskite vardą ir elektroninio pašto adresą žemiau:


Name: Vardas:
Email: Paštas:

Comments (1) Komentarai (1)

  1. Narayan Narayan

    This is a bash builtin . Tai bash BUILTIN. man bash and the builtin manual pops up showing history in there. man bash ir BUILTIN rankinis pasirodo rodo istorija ten.
    -N -N


Leave a Comment Palikite komentarą




Leave your Palikite friendly draugiškas comment here. komentarus.

If you have a computer help question, Jei turite kompiuteryje Pagalba klausimą, click here to leave it on the forums Spauskite čia, jei norite palikti jį dėl forumai instead. vietoj.

Note: Your comment may not show up immediately on the site. Pastaba: Jūsų komentaras gali būti rodomas iš karto svetainėje.

Our Friends Mūsų draugai
Getting Started Paruo


About How-To Geek Apie How-To Geek
What Is That Process? Kas yra šis procesas?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe Ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.