Different methods

>

The different ways in UNIX, one of the popular article series of The UNIX School:

1. How to find the length of a string or variable?.
2. How to print or display only the lines in a file which are not empty.?
3. How to split the PATH variable.?
4. How to get the total line count of a file?
5. How to do arithmetic operations in Linux.?
6. How to list the file without ls command.?
7. How to rename a group of files?
8. How to remove or delete the Control-M characters in a file?
9. How to add the first line and last line to a file.?
10. How to number the file contents?
11. How to dump the hex contents of a file?
12. How to join or concatenate all lines in a file?
13. How to find the sum of all the numbers in file?
14. How to split the file contents?
15. How to display the contents in a file?
16. How to capitalize the contents in a file?
17. How to retrieve the file name from absolute path?
18. How to print the first line or the header of the file?
19. How to zero pad a number or a variable?
20. How to print the first few characters of a file?
21. How to print the next few lines after pattern match?
22. How to reverse a string in Linux?
23. How to print the last line or the trailer of a file?
24. How to right pad a number or a string?
25. How to swap every 2 lines in a file?
26. How to reverse the order of file content?
27. How to join every 2 lines in a file?
28. How to insert a line before or after a pattern?
29. How to read 2 files line by line alternatively?
30. How to print few lines before a pattern match?
31. How to insert a line after every n lines in Linux?
32. How to change the delimiter of a file in Linux?
33. How to find sum of all columns / numbers in a line?
34. How to remove duplicate records from a file in Linux?
35. How to find duplicate records of a file?
36. How to find the total count of a word / string in a file?
37. How to remove a component of absolute path?
38. How to retrieve or extract the tag value from XML in Linux?
39. How to swap 2 columns in a file in Linux?

Note: For the complete list of all the articles of The UNIX School, check the 'Article Archive' in the right hand side.