Wirecard Frequently Asked Linux Interview Questions Answers

You Wish To Print The File Vacations With 60 Lines To A Page. Which Of The Following Commands Will Accomplish This?

The default page length when using pr is 66 lines. The -l option is used to specify a different length.

What Would Be The Result Of Issuing The Command Cat Phonenos?

The tac text filter is a reverse cat. It displays a file starting with the last line and ending with the first line.

You Need To See The Last Fifteen Lines Of The Files Dog, Cat And Horse. What Command Should You Use?

The tail utility displays the end of a file. The -15 tells tail to display the last fifteen lines of each specified file.

Which Field Is Used To Define The User's Default Shell?

command-The last field, called either command or login command, is used to specify what shell the user will use when he logs in.
Wirecard Frequently Asked Linux Interview Questions Answers
Wirecard Frequently Asked Linux Interview Questions Answers

When You Create A New Partition, You Need To Designate Its Size By Defining The Starting And Ending?

cylinders-When creating a new partition you must first specify its starting cylinder. You can then either specify its size or the ending cylinder.

What Can You Type At A Command Line To Determine Which Shell You Are Using?

echo $SHELL-The name and path to the shell you are using is saved to the SHELL environment variable. You can then use the echo command to print out the value of any variable by preceding the variable’s name with $. Therefore, typing echo $SHELL will display the name of your shell.

In Order To Display The Last Five Commands You Have Entered Using The Fc Command, You Would Type?

fc -5-The fc command can be used to edit or rerun commands you have previously entered. To specify the number of commands to list, use -n.

What Command Should You Use To Check Your File System?

fsck-The fsck command is used to check the integrity of the file system on your disk.

What File Defines The Levels Of Messages Written To System Log Files?

kernel.h-To determine the various levels of messages that are defined on your system, examine the kernel.h file.

What Account Is Created When You Install Linux?

root-Whenever you install Linux, only one user account is created. This is the super user account also known as root.

What Daemon Is Responsible For Tracking Events On Your System?

Syslogd-The syslogd daemon is responsible for tracking system information and saving it to specified log flies.

Where Standard Output Is Usually Directed?

To the screen or display-By default, your shell directs standard output to your screen or display.

What Utility Can You Use To Show A Dynamic Listing Of Running Processes?

Top-The top utility shows a listing of all running processes that is dynamically updated.

Who Owns The Data Dictionary?

The SYS user owns the data dictionary. The SYS and SYSTEM users are created when the database is created.

What Command Can You Use To Review Boot Messages?

dmesg
The dmesg command displays the system messages contained in the kernel ring buffer.
By using this command immediately after booting your computer, you will see the boot messages.

Nscd Sometimes Die Itself And Dns Resolving Doesn't Happen Properly. How Can We Avoid Nscd For Dns And There Is A Disadvantage To Bypass It?

nscd is a daemon that provides a cache for the most common name service requests. When resolving a user, group, host, service..., the process will first try to connect to the nscd socket (something like /var/run/nscd/socket).

If nscd has died, the connect will fail, and so nscd won't be used and that should not be a problem.

If it's in a hung state, then the connect may hang or succeed. If it succeeds the client will send its request (give IP address for www.google.com, passwd entries...). Now, you can configure nscd to disable caching for any type of database (for instance by having enable-cache hosts no in /etc/nscd.conf for the hosts database).

However, if nscd is in a hung state, it may not be able to even give that simple won't do , so that won't necessarily help. nscd is a caching daemon, it's meant to improve performance. Disabling it would potentially make those lookups slower. However, that's only true for some kind of databases. For instance, if user/service/group databases are only in small files (/etc/passwd, /etc/group, /etc/services), then using nscd for those will probably bring little benefit if any. nscd will be useful for the hosts database.

How Can I Redirect Both Stderr And Stdin At Once?

command > file.log 2>&1 : Redirect stderr to "where stdout is currently going". In this case, that is a file opened in append mode. In other words, the &1 reuses the file descriptor which stdout currently uses.

command 2>&1 | tee -a file.txt

What Is The Difference Between /dev/random And /dev/urandom To Generate Random Data?

The Random Number Generator gathers environmental noise from device drivers and other sources into entropy pool. It also keeps an estimate of Number of bits of noise in entropy pool. It is from this entropy pool, random numbers are generated.

/dev/random will only return Random bytes from entropy pool. If entropy pool is empty, reads to /dev/random will be blocked until additional environmental noise is gathered. This is suited to high-quality randomnesses, such as one-time pad or key generation.

/dev/urandom will return as many random bytes as requested. But if the entropy pool is empty, it will generate data using SHA, MD5 or any other algorithm. It never blocks the operation. Due to this, the values are vulnerable to theoretical cryptographic attack, though no known methods exist.

For cryptographic purposes, you should really use /dev/random because of nature of data it returns. Possible waiting should be considered as an acceptable tradeoff for the sake of security, IMO. When you need random data fast, you should use /dev/urandom of course.

Both /dev/urandom and /dev/random are using the exact same CSPRNG (a cryptographically secure pseudorandom number generator). They only differ in very few ways that have nothing to do with “true” randomness and /dev/urandom is the preferred source of cryptographic randomness on UNIX-like systems.

What Is The Difference Between Tar And Zip ?

Sometimes sysadmins Linux need to save data safety and to this, it is recommended to compress the data. We have some methods or commands for compression on Linux. So frequently asked s could be why should I use this command instead of another one example, why should I use tar instead of zip. To this, you should know the difference between the two.

tar is only an archiver whereas zip is an archiver and compressor. Tar uses gzip and bzip2 to achieve compression. With using tar command, we preserve metadata information of file and directories like seiuid, setgid and sticky bit information which are very important while zip doesn't preserve theses information. It is very important for criticals information. Other advantages of using tar is the fact that it assembles all the files into a single file to compress directly while zip compress file by file.

How To Check Open Ports On A Remote Server Without Netcat Or Nmap Linux Command?

In the work of sysadmin, we can sometimes want to check open ports on our remote server. But if we are on a machine where can not install nmap or we don't have the possibility to install a tool which can help us to check open ports, what could we do?

We can check it with bash using /dev/tcp or /dev/udp to open a TCP or UDP connection to the associated socket.

The command behavior is

$ echo > /dev/tcp/$host/$port

we can associate a message to display if the port is opened

$ echo > /etc/tcp/8.8.8.8/53 && echo "OPEN PORT"

OPEN PORT

$ echo > /dev/tcp/8.8.8.8/80 && echo "GOOD" || echo "NOT OPEN"

-bash: connect: Connection timed out

-bash: /dev/tcp/8.8.8.8/80: Connection timed out

NOT OPEN

Post a Comment

Previous Post Next Post