Q1 How do you remove the Control-M characters from a file? A1 Using the sed command that replaces Control-M with nothing
1 |
sed 's/^M//g' ReadWriteFile.sh > ReadWriteFileNew.sh |
Note: The ^M is typed on the command…
…Q1 How do you remove the Control-M characters from a file? A1 Using the sed command that replaces Control-M with nothing
1 |
sed 's/^M//g' ReadWriteFile.sh > ReadWriteFileNew.sh |
Note: The ^M is typed on the command…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
Q1 How will you go about reading a CSV file as shown below?
1 2 3 4 5 6 |
Portfolio,Account,PositionIndicator,Amount AA123,CURR-AUD,CREDIT,2244.14000000 AA123,CURR-AUD,CREDIT,5.60000000 AA123,CURR-AUD,DEBIT,2249.74000000 AA123,CURR-GBP,CREDIT,0.01000000 AA123,CURR-GBP,DEBIT,0.01000000 |
A1
If “openssh-server” & “openssh-client” are not installed in say “hostA”, then install them in “hostA” using “apt-get” with “sudo” for actions with root user privileges.
1 2 3 |
userA@hostA:~> sudo apt-get install openssh-server openssh-client |
The aim is to connect from “hostA” as “userA” to “hostB” as “userB” without being prompted to enter the password for userB@hostB.…
Q1 How will you delete files that are older than 7 days in a remote unix server? A1 By ssh ing to the remote host server
1 |
ssh user@host123 "find /etc/data/*.csv -mtime +7 -exec rm -f {} \;" >> myapp. |
sed (stream editor) is one of the powerful workhorse commands in UNIX. Recently I had to use it with “Git” and “Maven” to find text “SNAPSHOT” in all pom.xml files, and manually update them with a realease version like 1.0.2 without the suffix “SNAPSHOT”. Here is the command that I ran.…
In BigData projects relating to HDFS or AWS S3, it is common to have scripts that transfer or download data from HDFS to the local file system on an edge…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
Many industrial Java applications are developed om a WIN32 platfor, but run on a target platform, which is Unix based. If you are a beginner to Unix, and would like…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs