Friday, 6 January 2012

Linux Hard and Soft Links Examples


·        Go into the tmp directory:
·        cd /tmp;

·        Make a directory called original
·        mkdir original; cd original;

·        Copy the /etc/host.conf file or any file to test with here
·        cp /etc/host.conf .;

·        List the contents and take note of the inode (first column)
·        ls -il;   = 143265 -rw-r--r-- 1 Nasir Nasir 92 ……. host.conf

·        Create a symbolic link to host.conf called linkhost.conf
·        ln --symbolic -T host.conf linkhost.conf;

·        Now list out the inodes again
·        ls -il;   =132095 lrwxrwxrwx 1 nasir nasir 9 …….. linkhost.conf→host.conf

·        Notice if the the inode for the link is different?
·        Yes, inode for this link is different from the file host.conf

·        Now create a hard link to the same file called hardhost.conf
·        ln -T host.conf hardhost.conf;

·        Now list the inodes one more time
·        ls -il;   = 143265 -rw-r--r-- 1 Nasir Nasir 92 ……. hardhost.conf

·        Notice if the the inode for the link is different?
·        No, inode is same for file and its hard link.

·        Open up linkhost.conf and edit it and save it
·        vi linkhost.conf; (save :wq)

·        Now look in host.conf and notice if the changes were made
·        Yes, same changes appear in host.conf

·        Lets cut/paste host.conf up one directory and see if it causes any problems
·        mv host.conf ../; it moved seccussfully;

·        Do ls -l and see what is the result?
·        the line for linkhost.conf (softlink) appear black indicating broken link.

·        What is the result of cat linkhost.conf?
·        cat: linkhost.conf: No such file or directory

·        What is the result of cat hardhost.conf?
·        it works and opens host.conf although it is moved to upper directory.

Managing File Permissions and Ownership


·        List files which are readable for current user in /sbin directory
·        ls -l /sbin; find /sbin -perm -u=r -type f -exec ls -l {} \;

·        Create a file and change its permissions so that owner can only read the file and the respective group can read/write the file while other can read/write/execute the file using octal values
·        touch file; chmod 467 file;

·        Change the permissions of the file so that user can read/write/execute the file, group can read/execute the file and others can only read the file without using octal values
·        chmod u=rwx,g=rx,o=r test;

·        Create a new user “Lab_user” and change the ownership of the file to this new user
·        sudo useradd Lab_user; sudo chown Lab_user test; ls -l;

·        Create a new group “Lab_users” and assign this group to the file
·        sudo groupadd Lab_users; sudo chown :Lab_users test; ls -l;
·        sudo chgrp Lab_users test;

·        Change the default permissions to rwx rw- r--
·        umask 013;    (default is umask 022 )

·        Create directory so that only the owner or root can delete the directory
·        mkdir newdir; chmod go-w newdir;

·        Create a file so that when it is executed, the group ID of the process is changed to the group ID of the file
·        touch grp; chmod g+sx grp;

·        Create a new directory so that new files/directories created in this directory belongs to “Lab_users”
·        mkdir mydir; chmod g+sx mydir;

·        Create a file so that when the file is executed, the userID of the file changes to owner of the file
·        touch usrs; chmod u+sx usrs;

Wednesday, 4 January 2012

Linux Find Commands, Find commands in Ubuntu


1.      find
·         Find all lib files greater than 100 KB in /lib
·         find /lib -size +100k
·         This will print many file you can view smoothly by pressing ENTER just append “|more” with the command

·         Find all files which are smaller than 200 bytes
·         find -size -200b
·         There is no path specified so we can optionally specify path as current directory “.”

·         Find all symbolic links in /lib
·         find /lib -type l OR find -lname “*”
·         Both commands find the symbolic links. You prove by just “ls -l” any of the link.

·         Find all files which have been modified in last 24 hours
·         find -mtime 1
·         mtime used to find the updated files in days and if we want to see files with 36 hours, we have to find files which modified two days before by –mtime or calculate minutes and find files by –atime flag.

·         Find the file “cpuinfo” and print its first lines using “head” in the same command
·         sudo find / -iname ‘cpuinfo’ -exec head -1 {} \;
·         -name is case sensitive whereas –iname is case insensitive. –exec produeces new process and gets the results of the parent command in {} and ends with \.

·         Find your group name and ID, and search all files which belong to your group using group name and ID
·         id;    find -user 1000 -group 1000;
·         You can specify numeric userid and group as well as alphabetic names.

·         Find all files which have “.so” in their names using regular expressions
·         Find -iname “*.so”
·         * is the regex used for “all”

Basic Linux Commands, Ubuntu Commands


  Show the present working directory
  pwd

  Show the current user's session information in long format
  ps -l

  Show the current user's group membership
  id -g; id –gn

  Show the current user's PATH
  echo $PATH;

  List the contents of /boot in long format in three ways:
  Calling ls with an absolute path
  ls -l /boot;
  Calling ls with a relative path
  ls -l ../../boot;
  Changing directory to /boot and calling ls
  cd /boot ;ls -l

  Make a directory in the current user's home directory called lab2
  mkdir lab2

  Make two files in the lab2 directory: test and .test
   cd lab2; vi test; vi .test;  OR touch test ; touch .test;
  touch lab2/test ; touch lab2/.test; ls –alr lab2

  Make directory in the lab2 directory named sub1
  mkdir lab2/sub1; ls -alr lab2

  Change the permissions on test so only the owner can read and write the file and the file is not executable
  chmod 600 lab2/test; ls -alr lab2;

  Change the permissions on .test so the file is globally readable, write-protected, and globally executable
  chmod 707 lab2/.test; ls –alr lab2;

  List all processes for the current user and store the results into test
  who >> lab2/test ; ps –u $USER >> lab2/test;

  Use head to show the first line in test
  head -1 lab2/test

  Use tail to show the last line in test
  tail -1 lab2/test

  Use cat to show the contents of test
  cat lab2/test

  Change to the current user's home directory
  cd ~ OR cd

  Use find to recursively list the lab2 directory
  find lab2;

  Use ls to recursively list the lab2 directory
  ls -alr lab2

  Use rmdir to delete the sub1 directory
  rmdir lab2/sub1

  Use rm to delete the lab2 directory recursively
  rm –r lab2

References
http://www.cs.grinnell.edu/~walker/courses/161.sp09/readings/reading-linux-basics.shtml

Sunday, 1 January 2012

Define Attitude? Organization Attitude Effect On IT Project


Attitude:
                 In project management an attitude is a response toward an idea, event, in situation or                                          to a person positively or negatively. One other definition is a mental situation for any event, situation or idea and response to particular event.
Attitude and IT project:
 As we know from attitude definition that it is a response toward a particular event so attitude has a great effect on IT projects. Developing an IT project is a great challenge for IT project manager and his team. So every member and manager should have good attitude. Attitude provides confidence and it is very important in decision making. So a good project manager should have a good attitude. Organization attitude has a great effect on Projects. So a good project manager must have following properties.
I)                   Respect
II)                Responsibility
III)             Empathy
IV)             Trust
V)                Confidence  

 
Free Host | lasik surgery new york