LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-28-2010, 05:59 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
Interesting linux commands


I m writing an article over interesting linux commands .
I would be glad if someone adds to the list.

1)Command to find the Installation date of O.S.
2)How to find Most Used Linux commands of your machine?

===================================================
1)Command to find the Installation date of O.S.

Still dont remember last time you have installed an OS.
Dont worry Following command can help you get the exact date.

Method 1:
Code:
# tune2fs -l /dev/root | grep created
Filesystem created: Wed Oct 13 19:08:13 2010

Method 2:
First find the location of install.log in your machine.
Code:
# find / -name install.log
/root/install.log
then you can check the detail using ls -ltr /root/install.log.
Code:
# ls -ltr /root/install.log
-rw-r--r-- 1 root root 14038 Oct 13 13:40 /root/install.log
in above example install.log is created on Oct 13 So the OS is installed on 13th Oct.
===================================================
2)How to find Most Used Linux commands of your machine?

I know the question is quite simple but yet interesting.You can use following command to find out which is the most used command of your Linux Machine .

Code:
# cut -f1 -d" " .bash_history | sort | uniq -c | sort -nr | head -n 10
113 cd
98 ls
83 xm
64 cat
59 dir
59 df
55 find
48 sysctl
42 vi
36 mount
other way of doing the same thing.

Code:
# history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
113 cd
98 ls
80 xm
64 cat
59 dir
59 df
55 find
48 sysctl
42 vi
36 mount
from above output its very clear that "cd" is the most used command in my distribution.
I know there are no practical usage of this command but sometime its good to know which command stress your fingers

==================================================
 
Old 10-28-2010, 06:05 AM   #2
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 100Reputation: 100
An interesting address for who don't know: http://www.commandlinefu.com
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Interesting new Ubuntu-derived, OS X-inspired distro, interesting revenue (yes, LXer Syndicated Linux News 0 05-01-2009 09:51 AM
Interesting commands or programs for the CLI baldurpet Linux - Software 12 02-19-2009 02:30 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 07:53 AM


All times are GMT -5. The time now is 10:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration