abibur0945 发表于 2023-3-29 14:23:52

If you want to know the remaining disk space capacity of your hard disk

Here's how: grep 'word you want to search' 'file to browse' For example, suppose you want to find the word “photosynthesis” in the file “biologi.txt”. Then, you can type the following command: grep photosynthesis biologi.txt As a result, you will see a line containing the word “photosynthesis” in the file. 16. du Do you want to know how much disk space is already occupied in a directory? You can get the answer via the du command . Here's how to use it: du -h directory name For example, suppose you want to know the total size ( size ) of content in the /home/user/downloads directory, then you would type: du -h /home/user/downloads .

You only need to type the df command . The results will be displayed in kilobytes. However, if you want to view it in megabytes, you can write df -m . 18. diff This basic Linux command is very useful Uk Phone Number List for programmers. Because, the diff command can be used to compare the content in two different files. That way, the programmer can check whether there is a different code in the two files. For example, suppose they want to know if there are any code differences in file1.txt and file2.txt . They only need to type in the following command: diff file1.txt file2.txt 19. heads This command is used to display the first ten lines of text in a file.

https://mobilelead.me/wp-content/uploads/2023/03/Untitled.png

For example, suppose you wanted to see the first ten lines in the file revision1.txt , then you would write: head revision1.txt However, you can also set the number of rows displayed. You do this by adding the "-n number of lines" component in the middle of the command. So if you want to see just three lines, you can type: head -n 3 revision1.txt 20. tails Tail is the opposite of head. Because this command will display the last ten lines of text in a file. So, if you want to see the last ten lines of the revision2.txt file , you just have to type: tail revision2.txt And if you want to see only the last three lines, you can write: tail -n 3 revision2.txt 21. tar The tar command is more or less functional like WinRar or 7Zip.

页: [1]
查看完整版本: If you want to know the remaining disk space capacity of your hard disk