Posts Tagged With: cli

free Command

Tagged with: , , , ,

free gives the Memory info (in kilobytes).


free
#Output
             total       used       free     shared    buffers     cached
Mem:       2075000     667508    1407492          0      25988     352076
-/+ buffers/cache:     289444    1785556
Swap:       979924          0     979924

[tags][/tags]

No Comments »

last Command

Tagged with: , , , , , , ,

The last command shows a history of logins…


last
No Comments »

Finger Command

Tagged with: , , , ,

System info about a user. Try: finger root. An admin needs it all the time


finger user_name
#finger root
Login: root                             Name: root
Directory: /root                        Shell: /bin/bash
Last login Tue Nov 27 20:19 (IST) on tty1
No mail.
No Plan.
No Comments »

Run a Command if Another Command Succeeds

Tagged with: , , , , , , ,

This will let you run a linux command based on the success of anther command. Note: This will only work in bash shell.


ruby Create_PDF.rb && if [ $? == 0 ]; then kpdf report.pdf; fi 
No Comments »

Sort a File

Tagged with: , , , , ,

A Linux command to sort the contests of a file


sort file.ext

[tags][/tags]

No Comments »

Some Processor Intensive Commands

Tagged with: , , , , ,

I run these commands when I am off for lunch or something…


sudo /bin/bash /usr/sbin/makewhatis -w
sudo /usr/bin/updatedb

#These two only work on my system...
sudo /home/binnyva/Software/System/chkrootkit-0.47/chkrootkit
wish ~/Scripts/Tcl/Backuper/Backuper.tcl --nogui --start --type=Full
No Comments »

Merging a Branch with the Master Branch in git

Tagged with: , , , , ,

The commands needed to merge two branches in git.


git checkout master  
git merge BrachName
git commit -m "Merged" -a
No Comments »

Braching in Git

Tagged with: , , , , , ,

Use this command to create a new brach in a git Repository


git branch NameOfNewBranch
No Comments »

Connecting to a Remote MySQL Host

Tagged with: , , , , ,

You can connect to a remote mysql server if you have the necessary permissions…


mysql -h mysql.remote.com -u user 
No Comments »

Uptime

Tagged with: , , , , ,

See how long your machine has been running


uptime

Example Output
23:42:28 up 6:20, 2 users, load average: 0.16, 0.22, 0.17

23:42:28 – Current Time
6:20 – The system was on for 6 hours and 20 mins

No Comments »