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.

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:



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