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 Cum se afişează o listă de comenzi recente în Ubuntu Linux

Linux has a rich command line experience that can sometimes be a little daunting for people switching over from Windows. Linux are o experienta bogata linie de comandă, care poate fi uneori un pic descurajatoare pentru persoanele de peste comutarea de la Windows. Displaying the list of recent commands is pretty simple, though: Afisare lista de comenzi recente este destul de simpla, totuşi:

> history > Istoric

1 ps -ef 1 PS-EF
2 kill 24188 2 ucide 24188
3 ps -ef 3 PS-EF
4 tail logfile.log 4 logfile.log coadă

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. Dacă doriţi să găsiţi o comandă pe care aţi folosit înainte, dar aveţi o listă imensă de istorie, puteţi găsi rapid prin care trece printr-grep. Let's say we remember typing the ftp command, but can't remember the domain name of the server: Să presupunem că ne amintim tastarea comanda FTP, dar nu pot aminti numele de domeniu al serverului:

> history | grep ftp > Istorie | grep FTP

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

Pretty simple stuff! Destul de chestii simplu! 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: Ceea ce, dacă vrem pentru a afişa lista de articole pe care le utilizează cel mai des? Putem folosi o comandă mult mai complicate de genul:

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

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

The last command was thanks to Ultimei comenzi a fost mulţumită Lifehacker Lifehacker , which is a great site you should definitely subscribe to. , Care este o mare site-ul aboneaza-te si cu siguranta la.

The techniques used in the last command are useful in other contexts. Tehnicilor utilizate în cadrul ultimei comenzi sunt utile în alte contexte. I'll be posting more similar commands going forwards. Voi fi postaţi comenzi similare, mai merge înainte.

This article was originally written on 10/4/06 Tagged with: Acest articol a fost scris iniţial pe 10.4.06 Etichetate cu: SysAdmin Sysadmin , , Ubuntu Ubuntu

Daily Email Updates Daily Actualizări de email

You can get our how-to articles in your inbox each day for free. Aveţi posibilitatea să obţineţi modul nostru de-a articole în Inbox în fiecare zi pentru drum liber. Just enter your name and email below: Doar introduceţi numele dvs. şi e-mail de mai jos:


Name: Nume:
Email: E-mail:

Comments (1) Comentarii (1)

  1. Narayan Narayan

    This is a bash builtin . Aceasta este o Builtin bash. man bash and the builtin manual pops up showing history in there. bash om şi Builtin pops sus manualul de istorie în care arată acolo.
    -N -N


Our Friends Our Friends
Getting Started Noţiuni de bază


About How-To Geek Despre "Cum să" Geek
What Is That Process? Ce este acest proces?
svchost.exe svchost.exe
jusched.exe winampa.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. Toate drepturile rezervate.