20 Mar 2013

Linux Commands.

Linux Commands can do lot more which are almost never possible in for a programming to do in windows I think!!!.

One thing about linux, never do anythink without really knowing what you are doing.Linux Will allow you to do anything if you are a root user.

These are the commands I recently explored on linux(02-02-2013)

1.fdisk - details about disks on the system.

2.fsck - Check file systems on the system.

3.ntfsundelete - to restore the deleted files.

4.scalpel -   Recover files or data fragments from a disk image.

5.export - to add  environment variable to linux.Ex:to add path /home/user/pathwherejars to your class path.
   export CLASSPATH=$CLASSPATH:"/home/user/pathwherejars"

6.env - to see all the environment variable to linux.

7.To find all the users on linux
    cat /etc/password | cut -d ":" -f1

8.To find userid for a specific username
    id -u "username"

9.To search for a string in the whole directory files.
    grep -R "StringToBeSearched" filepath

    -n - print the line number of the match
    -i - ignore case

10.To know the shell for linux

    ps -p $$ // last column gives me my shell

11.To Know machine architecture if it is 32 bit or 64

   #getconf LONG_BIT

12.To check the user (root) owned files.
 
   # find . -user root

13.Find -size +1000M
 
   # find -size +1000M
 
14.Check for words from English dictionary look command

   # look floor

15.web page over HTTP for the directory structure tree and can be accessed at port 8000 (http:ipaddress:8000)

   python -m SimpleHTTPServer

16. java -cp /data/Mine/Scripts/jars/mysql-connector-java-5.1.18-bin.jar:.

  Note the :. in the end of the cp path, to include the current directory.

17. netstat - command to know the network connections, ports, routing tables... on linux system.use "man netstat" on you linux system to know more.

18. Set date in linux system using the following command

     date -s "29 JUN 2014 23:55:00"

19.  sudo update-java-alternatives -s java-1.7.0-openjdk-amd64

     Update the java in your system with any version available in your system.

20. To find the OS distribution

     cat /etc/*release
221.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.