Krishna Logo
qa training in canada now
Divied
Call: Harsha @ 571-386-2972

 

Loading
Latest News
Home Navigation Divied
DATABASE Navigation Divied UNIX/LINUX
Showing 1 - 10 of 21 Previous | 1 | 2 | 3 | Next
UNIX/LINUX
Subcategories
 

ALL THE POSTS BY SASHI SQL AND UNIX

 
 

USE THE BELLOW LINK TO DOWNLOAD THE LINUX SOFTWARE    ...  

 
 
3
UNIX
----
To log into any computer on network you need 
1. host name
2. user name
3. password
 
 
putty.exe - it connects to another unix machine in the network.
 
1 bit
8 bit = 1 byte
 
$ - Unix Prompt
 
Permissions of users:
---------------------
Read    - r - 4
write   - w - 2
Execute - x - 1
 
rwx or 421
 
user  - rwx
group - r_x
other - rw_
 
'/' - Root
 
UNIX - Case sensitve. 
all the commands in unix are in small letters
 
1. pwd
gives the path of the folder
 
2. clear
clear the work area
 
3. exit
exits out of the terminal
 
4. cal
gives the calender
 
5. date - display current timestamp
 
  date +%D - date part 
      +%T - time part of timestamp
+%H - hour
+%M - minute
+%S - Second
+%d - day (just day of the month)
+%m - 2 digit month
+%y - 2 digit year
+%Y - 4 digit year
+%b - abbreviated month
+%B - Fullname of the month
+%a - Abbreviated weekday 
+%A - Abbreviated Full Name Weekday
 
6. logname - displays the username
 
7. hostname - displays the hostname(server name)
 
8. man - similar to help
 
9. ls - displays all the directories and files in your current working directory
 
   ls -R  - display all the directories, files and subdirectories in your current working directory
      -l  - long list 
      -r  - reverse order
      -lr - long list in reverse order
      -t  - timestamp wise
      -lt
      -ltr or -lrt
      -a  - all files including hidden files 
      -P* - display directories starting with P
 
10. passwd - change the password
 
11. history - It will display all unix commands you used till date
    ! - can be used to get the previous commands
        !
 
12 mkdir - make a directory
   mkdir
 
13. cd -- change directory
    cd ..       - takes one step back 
    cd ../..    - 2 steps back
    cd f1/f2/f3 - 3 steps forward 
    cd ../f1    - 1 step back and 1 step forward
    cd /        - comes out of the home folder
    cd -        - Takes you to the last working directory
 
14. touch - creates a empty file with the current timestamp
       touch
    touch -t - changes the file to a specific time
       touch -t yymmddhhmm  
       - yymmddhhmm - yearmonthdatehourmin
 
15. cat - Displays content of a existing file or create a new file
cat - display content of the file 
cat > - creates a newfile or opens up a existing file for editing and all the existing data in 
  that file will be overwrited by the new file
cat >> - adds the data to the existing data or creates a new file
cat > - File1 data will be overwritten to File 2 data
cat >> - File 1 data will be added to the File 2 data 
 
16. cp - copies files and copied files have new timestamp
cp -p - copies files with the same timestamp
cp -i - will ask the permission to be over written or not
 
17. mv - rename the file
mv oldfilename newfile
 
18. chmod - change the permissions of a file
read    - 4
write   - 2
execute - 1
 
read - r user - u all - a
write - w group - g
execute - x others - o
 
+ Add permission
- Remove permission
= Assign Permission
 
     user group others
7    5   4
$ chmod 754 pr1
 
pr1 r-x rwx r--   ----> permissions
 
$ chmod u+w pr1
pr1 rwx rwx r--   ----> permissions
 
$ chmod g-w pr1
pr1 rwx r-x r--   ----> permissions
 
$ chmod u=rwx pr1
$ chmod u=rwx,g=rx pr1
 
19. rm - removes files
rm
rm * - removes all the files starting with that letter
 
20. rmdir - removes directories
rmdir -  removes empty directory 
rm -r - removes directory and the content inside it
rm -ir - asks for confirmation
 
21. file - displays what type of file 
$ file
 
22. head - displays number of lines from top
$ head -5 - displays first 5 lines
 
23. tail - displays number of lines from bottom
$ tail -3 - displays last 3 lines
 
24. link - links one file to another file. 
- you can always link to new file you cannot link to existing file.
$ link
 
25. find - finds the files and directories 
$ find . -name '' -print
. - specifies the working folder
-name - syntax that says we are searching a name
- specifies the name you are searching in the folder 
-print - prints the output in the window 
or
 
$ find /home/krishnatraining1 -name '' -print
 
$ find . -name '' -type f -print --> displays files with this name
$ find . -name '' -type d -print --> displays directories with this name
$ find . '*.txt' -print --> displays all the .txt files in the working folder
$ find . '*.jpeg' -print 
 
26. comm - compares two files and displays the common values in one line and unmatched records in another line
 
$ comm
 
 
27. cmp - compares both the files and returns no data if both the files are equal.
 
$ cmp  
 
28. sort - will sort the data in the file
 
$ sort     - Ascending
$ sort -r  - Descending
$ sort -n  - Sorting on the numbers
$ sort -t ';' -k2 - sorting delimeted files
    -k2 - specifes sorting on columns
$ sort -k2 - if the file is a tab delimited file
 
29. wc - counts of lines, words or letters(characters)
 
$ wc -l - Count of lines in the file
$ wc -w - Count of Words in the file
$ wc -c - Count of characters(letters) in the file
 
30. FTP - File Transfer Protocol
 
30. $ ftp - Command to log into the remote server
   ftp cd  - when logged in remote server 'cd' will change folders in remote server
31. ftp lcd - when logged in remote server 'lcd' will change folders in local server
32. ftp lpwd - displays the local machine path
33. ftp put - copies files from local to remote server 
34. ftp get - copies files from remote to local machine
35. ftp bye - logging out of remote server
 
$ pwd
- /home/main
$ ftp userx/password @ xyz
ftp pwd
- /x
ftp cd y/z
ftp pwd
- /x/y/z
ftp lcd b/b1
ftp put customer.txt
ftp cd ../..
ftp lcd ../b2
ftp get x.txt
ftp cd y/z
ftp lcd ../../c/c1
ftp get z.txt
ftp bye
 
36. diff - compare two files and display difference in details. It gives no output if both the files are equal
 
$ diff
a - added 
c - changed
d - deleted
 
37. printenv - Prints all the environmental variables
 
$ printenv
 
38. echo - displays the text 
 
$ echo
 
39. sleep - it allows the system to sleep for specified time 
 
$ sleep 5s - seconds
$ sleep 5m - minutes
$ sleep 5h - hours
$ sleep 5& - sleep process running in background
 
40. ps - it shows all the processes running and gives the information related that process - PID (Process ID)
 
$ ps
 
41. fg - it brings the process to foreground
   
$ fg % ProcessID
 
42. bg - it brings the process to background 
 
$ bg % ProcessID
 
43. kill - completly kills the process - force kill until the root
 
$ kill -9 ProcessID
 
44. nohup - no hangup, makes the process run on the server
 - process runs in background
$ nohup ProcessID
 
45. cut - to displays specific columns
- can be used for all the delimiters
 
$ cut -f c1,c2...
 - by default this command will execute for tab delimited file
$ cut -f c1,c2,.. -d ';'
 - for a ';' delimited file
 
46. gzip - will compress the file (similar to winzip)
- original file will be replaced with the zipped file
 
$ gzip  
 
47. gunzip - will uncompress the file
 
$ gunzip
 
48. zcat - display the contents of a compressed file (zipped)
 
$ zcat
 
49. more - allows you to read long documents
 
$ more
enter - next line
space - next page
q     - quit 
 
50. less - allows you to read the documents in smaller compressed window
 
$ less
enter - next line
space - next page
q     - quit 
 
51. grep - globally searches the complete file for a word or a phrase and prints
 
$ grep 'search_phrase'
- will display all the lines that has the search_phrase
 
$ grep -w 'search_phrase'
- will display all the lines considering search_phrase as a word.
 
$ grep -i 'search_phrase'
- Makes the search case sensitive independent
 
$ grep -v 'search_phrase'
- Displays all the lines that doesn't have the search+phrase
 
$ grep -n 'search_phrase'
- Displays all the line that has the search_phrase with the line numbers
 
$ grep '^I'
- displays all the lines starting with 'I'
 
$ grep -i '^I'
- displays all the lines starting with 'I' and makes it case sensitve independent
 
$ grep 'I$'
- displays all the lines ending with 'I'
 
$ grep '^IS$'
- all the lines starts and ends with 'IS'
 
$ grep '^$'
- Displays the null value lines
 
$ grep '^..$'
- Display any line that has two characters
 
52. mail - helps to email the recepient
 
$ mail -s 'HELLO' abc@abc.com --> subject
$ mail -c  --> cc
$ mail -b  --> bcc
$ mail -a  --> attach a file
 
53. split - it helps to split the big file into multiple small files
 
$ split
- by default it splits the lines in 1000 lines interval
 
$ split -l2000
 
$ split -d
- display number instead of alphabets
 
54. whoami - shows the current user name
 
$ whoami
 
55. uname - gives the processor and computer details
 
$ uname
$ uname -a
 
56. uniq - this is a unix untility that collapes or merges identical rows into a single row
         - Always provide sorted input into the uniq command
 
$ uniq
$ uniq -i - removes case sensitivity
$ uniq -c - count of each row
$ uniq -d - display duplicate rows
$ uniq -u - diaplay only unique rows
 
 '|' - pipe operator --> can be used to give input for the next statement
 ';' --> it seperates the commands
 
57. sed - stream editor
 
$ sed -n r1,r2..p
- displays the lines r1, r2
 
$ sed s/is/was/g
- replaces the existing string with a new string
 
UNIX CLASS NOTES
Date Posted: 11/12/2013

UNIX ---- To log into any computer on network you need  1. host name 2. user name 3. password     putty.exe - it connects to another unix machine in the network.   1 bit 8 bit = 1 byt...  

 
 

  download putty.exe file to connect to the unix server using t...  

 
 

CLICK HERE TO DOWNLOAD

 
 
6TESTPOST
Date Posted: 06/17/2013

SDFKLJASLFDJLKASJDFL

A

SDF

AS

DF

AS

DF

AS

DF

 

 
 
7WRITTEN TEST FOR BACKEND TESTERS
Date Posted: 06/17/2013

  1. what are sed, awk,xargs
  2. how do you list files in directories
    Ans: ls command

     
  3. how do you log files
    Ans: 
  4. grep with directories
     
  5. cat cmmand
     
  6. how to look nth line in file, example i want to see the line 789 in a file which has 1000 lines
    sed -n '789p' file
  7. question about file system
  8.  
  9.  
  10. what is chmod .. what are different permissions
    Chmod is a Unix command that lets permission levels be assigned to each file or directory.
     
    The three digits in a permission (for example, 644), represent permissions for the owner, the group and the world, respectively. Common digits include 4 (read only), 5 (read and execute), 6 (read and write) and 7 (read, write and execute). These are permissions as far as the operating system is concerned, not visitors to your web site. In a secured hosting environment, 666 or 777 are not dangerous, but 644 or 664 are the recommended permissions for everyday use. Please read about why chmod 777 is NOT a security risk for more information on the topic.
  11. what is lprm
    lprm:  this command remove jobs from the line printer spooling queue
     
  12. communication command in unix
    click here to download
  13. there were two syntax what would be the output
  14. if i have a unix file with 100 lines in it how do you retrieve 30 to 40 lines
    Ans: tail -70 ||head -40
    tail command retrieves last 70 lines and out put of tail command will be given to input of head command and it will retrieve  top 40 of the 70 lines retrieved in the previous tail command
  15.  

 

  1. who,sort, cat,file,logfiles
     
  2. how to count words in file
    wc command will give the number words in a file
  3.  
  4. in sql
  5. what are dcl , dml, ddl
  6. recursive command in sql
  7. What is view
  8.  
  9.  
  10. difference between having and where clause
  11. what is self join and explain with example
  12.  
  13. there were few tables
  14. asked me to write query to find duplicate rowsasked me to write query to find duplicate rows
  15. delete duplicate rows
  16.  
  17. replace all the null values in manager column as no manager
  18.  
  19. two tables in two different database compare two rows
  20.  
  21.  
  22. there were two query where i had to use group by and having clause
  23. Random 25 record from the table
  24. questions about primary key in table(can table has two primary key
  25. who can write primary key in table
  26. how to fill default value in the field
  27. want to delete field content from the file what will you use drop,delete,truncate?
  28. whatis dml statement
  29. delete
  30. update
  31. insert
  32. these are mixed question with new and old one

 
 

Location of System logs The "/etc/rsyslog.conf" file defin...  

 
 
9INTERVIEW TECHNICAL WRITTEN TEST
Date Posted: 05/31/2013

  1. what are sed, awk,xargs
  2. how do you list files in directories
    Ans: ls command

     
  3. how do you log files
    Ans: 
  4. grep with directories
     
  5. cat cmmand
     
  6. how to look nth line in file, example i want to see the line 789 in a file which has 1000 lines
    sed -n '789p' file
  7. question about file system
  8.  
  9.  
  10. what is chmod .. what are different permissions
    Chmod is a Unix command that lets permission levels be assigned to each file or directory.
     
    The three digits in a permission (for example, 644), represent permissions for the owner, the group and the world, respectively. Common digits include 4 (read only), 5 (read and execute), 6 (read and write) and 7 (read, write and execute). These are permissions as far as the operating system is concerned, not visitors to your web site. In a secured hosting environment, 666 or 777 are not dangerous, but 644 or 664 are the recommended permissions for everyday use. Please read about why chmod 777 is NOT a security risk for more information on the topic.
  11. what is lprm
    lprm:  this command remove jobs from the line printer spooling queue
     
  12. communication command in unix
    click here to download
  13. there were two syntax what would be the output
  14. if i have a unix file with 100 lines in it how do you retrieve 30 to 40 lines
    Ans: tail -70 ||head -40
    tail command retrieves last 70 lines and out put of tail command will be given to input of head command and it will retrieve  top 40 of the 70 lines retrieved in the previous tail command
  15.  

 

  1. who,sort, cat,file,logfiles
     
  2. how to count words in file
    wc command will give the number words in a file
  3.  
  4. in sql
  5. what are dcl , dml, ddl
  6. recursive command in sql
  7. What is view
  8.  
  9.  
  10. difference between having and where clause
  11. what is self join and explain with example
  12.  
  13. there were few tables
  14. asked me to write query to find duplicate rowsasked me to write query to find duplicate rows
  15. delete duplicate rows
  16.  
  17. replace all the null values in manager column as no manager
  18.  
  19. two tables in two different database compare two rows
  20.  
  21.  
  22. there were two query where i had to use group by and having clause
  23. Random 25 record from the table
  24. questions about primary key in table(can table has two primary key
  25. who can write primary key in table
  26. how to fill default value in the field
  27. want to delete field content from the file what will you use drop,delete,truncate?
  28. whatis dml statement
  29. delete
  30. update
  31. insert
  32. these are mixed question with new and old one

 
 

http://www.ee.surrey.ac.uk/Teaching/Unix/unixintro.html

 
Showing 1 - 10 of 21 Previous | 1 | 2 | 3 | Next
Shadow Bottom
   
© 2005 - 2018 Krishna Training.
Designed & Developed By BitraNet