There are many more commands available in Linux that deal with files. In this section I show how to use a few of them.
The following are some of the commands I find myself using all the time:
Run the following command:
cd /tmp
Create a file:
dmesg > file1.txt
Now run
ls -la
and remember the info. We will use this later.Use the
stat
command to see practically everything you would ever want to know about the file:stat file1.txt
Now suppose you have sent that file to someone that is running a Linux system, and want to ensure it did not get corrupted along the way. Run the following command:
sum file1.txt
The first number is the checksum and the second is the number of blocks for that file. If the other person runs
sum
on his copy of the file and sees the same info, the files are the same.We have created a lot of files by using the redirection operator. You can also use the touch...