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 Bagaimana menampilkan daftar perintah baru-baru ini di Ubuntu Linux

Linux has a rich command line experience that can sometimes be a little daunting for people switching over from Windows. Linux memiliki baris perintah kaya pengalaman yang kadang-kadang bisa sedikit menakutkan bagi orang-orang beralih dari Windows. Displaying the list of recent commands is pretty simple, though: Menampilkan daftar perintah baru-baru ini cukup sederhana, meskipun:

> history > Sejarah

1 ps -ef 1 id-ef
2 kill 24188 2 membunuh 24.188
3 ps -ef 3 id-ef
4 tail logfile.log 4 ekor 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. Jika Anda ingin mencari sebuah perintah yang anda gunakan sebelumnya, tetapi Anda memiliki sejarah besar daftar, Anda dapat dengan cepat menemukannya dengan cara melewatkannya melalui grep. Let's say we remember typing the ftp command, but can't remember the domain name of the server: Andaikan saja kita ingat mengetikkan perintah ftp, tetapi tidak dapat mengingat nama domain server:

> history | grep ftp > Sejarah | grep ftp

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

Pretty simple stuff! Pretty simple 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: Bagaimana jika kita ingin menampilkan daftar item yang kita gunakan paling sering? Kita dapat menggunakan perintah yang lebih rumit seperti ini:

> history|awk '{print $2}'|awk 'BEGIN {FS=”|”} {print $1}'|sort|uniq -c|sort -r > History | 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
24 uptime 24 uptime
15 mysql 15 mysql
13 vi 13 vi

The last command was thanks to Perintah terakhir Berkat Lifehacker Lifehacker , which is a great site you should definitely subscribe to. , Yang merupakan situs besar Anda harus benar-benar berlangganan.

The techniques used in the last command are useful in other contexts. Teknik yang digunakan dalam perintah terakhir berguna dalam konteks lain. I'll be posting more similar commands going forwards. Saya akan posting lebih ke depan akan perintah sejenis.

This article was originally written on 10/4/06 Tagged with: Artikel ini awalnya ditulis pada 10/4/06 Tagged with: SysAdmin SysAdmin , , Ubuntu Ubuntu

Daily Email Updates Harian Email Pembaharuan

You can get our how-to articles in your inbox each day for free. Anda bisa mendapatkan kita bagaimana-untuk artikel dalam kotak masuk Anda setiap hari secara gratis. Just enter your name and email below: Cukup masukkan nama dan email Anda di bawah ini:


Name: Nama:
Email: Email:

Comments (1) Komentar (1)

  1. Narayan Narayan

    This is a bash builtin . Ini adalah bash builtin. man bash and the builtin manual pops up showing history in there. man bash dan manual builtin muncul sejarah menunjukkan di sana.
    -N N


Leave a Comment Tinggalkan Komentar




Leave your Meninggalkan friendly ramah comment here. komentar di sini.

If you have a computer help question, Jika Anda memiliki pertanyaan bantuan komputer, click here to leave it on the forums klik di sini untuk meninggalkannya di forum instead. selain.

Note: Your comment may not show up immediately on the site. Catatan: Komentar anda mungkin tidak muncul segera di situs.

Our Friends Our Friends
Getting Started Persiapan


About How-To Geek Tentang How-To Geek
What Is That Process? Apa Proses Itu?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
mDNSResponder.exe mDNSResponder.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.