xxxxxxxxxx
//part 2
1. du: //gives the information about the disc accoupied by a file or folder
du directory_path // to see usage of that folder
du -h directory_path // in human format
du -sh directory // -s flag for getting size of complete directory instead of each file
du -m directory // gives data in MBs
du -h direcotry_path --exclude="file" // get data of all excluding certain file pattern
2. head: // command that allows you to view first 10 lines of the file
head -n 5 file.txt // prints first five lines
head -5 file.txt // this command works same as above
head -n -5 file.txt // this print all the first lines except last five
head -q file.txt file2.txt // this quits printing file names as a headers
head -c 2 file.txt // outputs the no. of bytes
3. tail: // command that allows to view last 10 lines of a file
tail -3 file.txt // prints last three lines
tail -n 3 file.txt // works same as above
tail -c 50 file.txt // it will print last 50 bytes from the file
tail -f file.txt // this will monitor file for the change -f meaning follow
tail -q file.txt file2.txt // this will not print file name as headers
tail -v file.txt // -v verbose this will print file names as header
4. diff:// shows the difference between two files
diff -c file1.txt file2.txt // show the diff in context form
diff -u file1.txt file2.txt // show the diff output without any redandant information
diff -i file1.txt file2.txt // makes the diff command case insensative
5. tar://this command archives multiplle files into TAR file