1. inode- Inode stores the information of a file present on the file system,
The Inode typically contains the mode of access to the file, Information about the owners, disk location where the file is present and the what type of file it is,ID of the device,etc. And it stores all these information in the form of a Data structure.
In Unix there is a Index table containing the inode number which is unique to every inode and uses that number to access the inode content.
ls command is used for listing the files present in the file system.when you add the option "-i" along with the ls command,It displays the output where the inode number is present in the first column.
Every Regular file in the file system has a unique inode that contains the information of that particular file and it can not be changed.Since the file system is the one managing the inode, we can not change it .
So, The only way to get a different inode for the same file is to create a copy of that file.
When you create a copy of the file it will get a new inode which will then contain the information of the new copied file.
To create a copy of a file you need to use "cp" command. The cp command can be used to create a a copy of a file or a whole directory.
$ cp source destination
source is the file you want to create a copy of and destination is the new location where the file will get copied to.
for e.g; $ cp Regfile \Desktop
This will create a copy of the Regfil in the \Desktop with the same name but with different inode.
Another command which can be used to change the inode is the "mv" command which is used for moving or renaming mainly.
If you move the file in the inside the file system ,then the inode will not change and remain the same.So, to get a different inode you must move the file to a different file system. For that you can do;
$ mv RegFile /tmp
here /tmp denotes the different filesystem
so now when you use " $ ls -i /tmp/RegFile" you will see the same file name with different inode number . As mentioned above the file system manages the inode so changing the file system will change the inode number as well.
1. First to understand whether if the hole in a Unix file affects the logical or the physical size of the file you must understand what the hole in a file means,
Hole in a unix file is are the empty spaces that contains null characters and dont take up any space on the disk.
For e.g to create a hole. "dd" command is used.
$ dd If=/dev/holefile bs=1024 seek=7
when you use the above command the /dev/holefile will contain 7168 null characters.
And the holes are not allocated in the disk space.
Logical size signifies the actual data blocks that is used, While the Physical size signifies the total data blocks assigned to the file.A file with holes generally will have a larger logical size than its physical size as the holes in the file are not assigned any data block.One example are the sparse files which instead of using data blocks store the metadata of the holes. and thus there logical size is greater than the physical size.
1. SSH stands for Secure Shell which is used for security of a connection between a client and a server by providing authentication methods.
Steps to setup key based login using SSH-
1.check whether there is any existing ssh key pair to avoid overwriting - $ ls -al home/.ssh/id_*.demo (home denotes the homedirectory can also be replaced by ~)
If you already have a key then you can use that or If you don't already have a existing key pair then
2. Generating a SSH key pair
$ ssh-keygen -t rsa -b 1024 -C "comment" :this will generate a 1024 bits ssh key pair with the comment you provided.
And press Enter for using the default file name and file location.
3. Now, the ssh-keygen tool will require a passphrase for security purpose, you can either enter a passphrase or just keep it blank and not use it.
4. to list the public and private key generated by SSH you can use
$ ls home/.ssh/id_*
5.After the key is generated you need to copy the public key to the server so that you are able to manage it.To copy the public key to server use $ ssh-copy-id command ,This will lead to a prompt asking for a password.
6.After authentication the public key will be appended to the remote user file and connection will close.
Now you will be able to log in without using any password using $ ssh
[1] How can you change the inode associated with a regular file? Specifically, what commands can...
Linux 1. How can you enable, on a default Linux installation, root remote access through ssh? 2. A boot loader can be configured to boot multiple Linux kernels that use the same partition as their root file system. True or False? 3. Which of the following occurs first when a computer is booted? the BIOS displays a setup menu of configuration options. The kernel starts the init program. The BIOS loads the MBR. The CPU starts executing commands found in...
QUESTION 1 What will be the output of following Unix command: find / -name ‘*’ A. List all files and directories recursively starting from / B. List a file names * in / C. List all files in / directory D. List all files and directories in / directory QUESTION 2 Which command is used to extract a column/field from a text file / input. A. paste B. get C. cut D. tar QUESTION 3 Which command creates an empty...
I have included what I need to do for part b, and what I have so far. I 2.2 Part B Write a default version of program to report the behavior of the Linux kernel by inspecting kernel state. The program should print the following values to the user screen or console: CPU type and model Kernel version Amount of time since the system was last booted, in thefomdmm:5s (for example, 3 days 13 hours 46 minutes 32 seconds would...
Lab 10: ArrayLists and Files in a GUI Application For this lab, you will work on a simple GUI application. The starting point for your work consists of four files (TextCollage, DrawTextItem, DrawTextPanel, and SimpleFileChooser) in the code directory. These files are supposed to be in package named "textcollage". Start an Eclipse project, create a package named textcollage in that project, and copy the four files into the package. To run the program, you should run the file TextCollage.java, which...
Can you piea se Show how 4a 2 got the answer F helps me. understand H better Thant you So much Problem 1 REGIONAL AIRLINES Regional Airlines is establishing a new telephone system for handling flight reservations. During the 10:00 A.M. to 11:00 A.M. time period, calls to the reservation agent occur ran- domly at an average of one call every 3.75 minutes. Historical service time data show that a reservation agent spends an average of 3 minutes with each...
could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...